cookies

Android app remain logged into website, cookies? Session?

為{幸葍}努か 提交于 2020-01-01 03:43:06
问题 I'm looking to make an android app that is basically a custom view of a text based gaming website. I know how to do HttpPosting and such, so sending login information is relatively simple. But my question is, how would I go about then navigating the site? I've never really worked with sessions and cookies on the client side. Is a cookie the right way to implement this? How do I pass the info back to the server when accessing subsequent pages? I hope that makes sense 回答1: Generally, in Java

Android WebView HTTP Cookies not working in API 21

◇◆丶佛笑我妖孽 提交于 2020-01-01 03:21:12
问题 I have an Android application that uses WebView and HTTP cookies. This application works on Android devices running API 19 or below. API 21 is not saving the http cookie for later reference. Android WebView Code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_token); WebView mWebView = (WebView) findViewById(R.id.activity_main_webView1); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

Devise not working well with multiple subdomains on RoR3 application

徘徊边缘 提交于 2020-01-01 02:46:08
问题 I have seen a lot of questions about this topic, but a lot of them have contradictory information, and for some reason it didnt work for me. I have: a top level domain: i.e. lvh.me (development). each user has subdomains: i.e. userdomain.lvh.me The login form is in the top level domain: lvh.me I want: If an user logs in, the session needs to be shared between all the subdomains. I mean, the session needs to be active in lvh.me:3000/something and userdomain.lvh.me:3000 If an user logs out from

Replace multiple characters in a string in javascript

这一生的挚爱 提交于 2020-01-01 02:31:35
问题 I got this nice code, which I have no idea why doesn't work. It should get the value of a text input and replace each given national character with it's HTML code, for compatibility purposes. But, when I click the button, the function returns the string without any changes. Any idea? (jsfiddle) <a id="reminder1" onclick="document.getElementById('reminder2').style.display = ''; document.getElementById('reminder1').style.display = 'none';"> Set reminder </a> <a id="reminder2" class="reminder"

Removing cookies with the same name but different paths

…衆ロ難τιáo~ 提交于 2020-01-01 02:11:33
问题 I need to delete clientside cookies with the same name but with different paths. What is the best way to do this in javascript. 回答1: Just specify the same path of the cookie you want to remove, giving it a past expiration. document.cookie = 'name=value1; path=/'; document.cookie = 'name=value2; path=/path/'; alert(document.cookie); // name=value1; name=value2 document.cookie = 'name=; path=/path/; expires=' + new Date(0).toUTCString(); alert(document.cookie); // name=value1 Changing it to

Removing cookies with the same name but different paths

↘锁芯ラ 提交于 2020-01-01 02:11:07
问题 I need to delete clientside cookies with the same name but with different paths. What is the best way to do this in javascript. 回答1: Just specify the same path of the cookie you want to remove, giving it a past expiration. document.cookie = 'name=value1; path=/'; document.cookie = 'name=value2; path=/path/'; alert(document.cookie); // name=value1; name=value2 document.cookie = 'name=; path=/path/; expires=' + new Date(0).toUTCString(); alert(document.cookie); // name=value1 Changing it to

Is there a setting on Google Adsense to suppress use of cookies for users who have not yet given consent

拈花ヽ惹草 提交于 2020-01-01 02:09:05
问题 Update: I have split my original question into two to let each one be more cohesive. According to EU Article 5(3) of the E-Privacy Directive (a.k.a 'The Cookie Laws'), web sites that target EU users have to gain opt-in consent from users before they set a cookie. See ICO Guidence I am trying to square this with Google Adsense on my web site. I would imagine that Google Adsense can serve ads without having to set cookies. However, I cannot find any info on this (on the Google sites/settings

Alternative to HTTP Cookies?

≯℡__Kan透↙ 提交于 2020-01-01 01:59:07
问题 They say Cookies are bad. I personally believe there should be a "smarter" way to detect the state of a user on a web app. Say, currently this is how it works in a distributed environment where xyz.com has many pools and servers (which i know of): User logs in xyz.com The login module of xyz.com drops a cookie on client's local machine. Now, when the client goes to Feature1 of xyz.com, the feature1 pool checks for a local cookie, if he finds it and if it has not expired then Feature1 assumes

Checking if user has changed cookie value, manually

和自甴很熟 提交于 2019-12-31 22:54:12
问题 I am busy with a login system for my project. Just for an extra step to the security.. How can I check/detect if a user has manually changed a cookie value? Is there some easy way of doing this? Or do I have to set an extra Session variable and match it up with that? With this being said, is a normal ASP.Net Session traceable by the browser? And viewable to the user? Thanks. 回答1: You could append a digital signature to the cookie value and check the signature when you read it back. That way,

How do you use cookies and HTTP Basic Authentication in CherryPy?

江枫思渺然 提交于 2019-12-31 10:55:00
问题 I have a CherryPy web application that requires authentication. I have working HTTP Basic Authentication with a configuration that looks like this: app_config = { '/' : { 'tools.sessions.on': True, 'tools.sessions.name': 'zknsrv', 'tools.auth_basic.on': True, 'tools.auth_basic.realm': 'zknsrv', 'tools.auth_basic.checkpassword': checkpassword, } } HTTP auth works great at this point. For example, this will give me the successful login message that I defined inside AuthTest : curl http:/