session-cookies

$_SERVER['HTTP_COOKIE'] return's two PHPSESSID

狂风中的少年 提交于 2019-12-05 14:47:31
I am getting two PHPSESSID while printing $_SERVER['HTTP_COOKIE'] . Actually I don't know how it is set twice, its only in my local system. When I check the SERVER cookie it like: echo $_SERVER['HTTP_COOKIE']; //result 'fe_toolbar=false; fe_toolbar=false; PHPSESSID=4tvbovcjk0msf9dvibeb31c2b7; langId=1; backendLangId=2; PHPSESSID=46aagg1hg7as2uh9bihjlpp8h7' When I check my cookie alone like : print_r($_COOKIE); //result array ( 'fe_toolbar' => 'false', 'PHPSESSID' => '4tvbovcjk0msf9dvibeb31c2b7', ) You can have multiple cookies with the same name. This happens when you set cookie with different

Disable Cookie read/write in webbrowser c# application

南楼画角 提交于 2019-12-05 13:28:48
I want websites to not able to read cookies or write new cookies in a webbrowser c# control application. I will prefer to disable all read/write cookies operation for all websites when the webbrowser c# application runs, if not then I have a list of websites whose read/write cookies operation should be disabled. I am using .NET 2.0 framework but can also use 4.5 JoshVarty You can't disable cookies only on your web browser control. The control is essentially an embedded Internet Explorer and shares the user's Internet Explorer settings. If you don't mind blocking cookies on all other instances

how do I test httpOnly cookie flag

两盒软妹~` 提交于 2019-12-05 11:02:45
问题 I have set the following property in websphere for the jsession cookie com.ibm.ws.webcontainer.HTTPOnlyCookies . Any idea how best to test this using JavaScript in Firefox or IE? 回答1: It's a pain in IE. I have IE9 so your screens may be different. Press F12, go to the network tab, and then press Start Capturing. Back in IE then open the page you want to view. Back in the F12 window you show see all the individual HTTP requests, select the one that's the page or asset you're checking the

Sessions and Cookies to autologin in GWT

假装没事ソ 提交于 2019-12-05 10:48:02
i know there is a lot of questions on this already but I still didn't seem to find a definitive answer. What i'm looking to do is have users be remembered after they login for say 2 weeks or until they log out. Below is what I think should be happening and I was wondering if anyone with a bit more experience could tell me if i'm right or wrong. User logs in for the first time. An RPC call to the server returns a 'UserInfo' object which includes with it a new sessionID. Aka on the server this happens and user is returned: user.setSessionId(getThreadLocalRequest().getSession().getId()); Now

How to detect a returning visitor, and redirect to a specific URL? [closed]

感情迁移 提交于 2019-12-05 08:16:26
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am developing a new website that needs the ability to detect if the user has visited the website previously, then direct them to a specific URL (i.e. example.com/welcomeback.html) if they have. I assume that

How to do auto login, store the session in the browser

对着背影说爱祢 提交于 2019-12-05 07:28:28
问题 I have seen some social network sites, if you have a user account, and when you open the browser and type the url, you will be directly loged in without inputting the username and password even if you close the computer and restart the browser your can still be automatically loged in which is different form before which you need to log in with your log in details, I think this is not only include the session cookie like the following setcookie(session_name(), '', time()-2592000, '/'); but

Where can I find a PHP/MySQL implementation of Charles Miller's “Persistent Login Cookie” solution?

偶尔善良 提交于 2019-12-05 07:16:44
问题 I have seen time and again Charles Miller's "Persistent Login Cookie Best Practice" recommended here as the absolute best way of implementing "Remember me" functionality on a site (if you really, really need that feature, which I do). However, I've scoured the web and I can't find any actual PHP/MySQL code implementing his solution, and since "security" was stressed about a gazillion times with regard to using "Remember me", I'm afraid to code it myself from scratch for fear that I will

servlet set cookie secure?

…衆ロ難τιáo~ 提交于 2019-12-05 05:28:24
javax.servlet.http.Cookie implements java.lang.Cloneable In Cookie method, there is a method call "setSecure" , what does it use for? if i setSecure(true), is there anything i need to do on my client(javascript) side to read the cookie? what is different set/without setSecure? All that setSecure(true) does is tell the browser that the cookie should only be sent back to the server if using a "secure" protocol, like https . Your JavaScript code doesn't have to do anything different. Yup this ensures that your session cookie is not visible to an attacker like man-in-the-middle attack. Instead of

Set cookie (with JS) for whole domain not specific page

你。 提交于 2019-12-05 04:04:04
问题 I have a simple little script which I am using to set a cookie: function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } The problem I have this cookie is only set on one page, not across the whole domain. How can I adjust this function so that the cookie remains across the whole domain? 回答1: You can specifiy domain ;domain=.example.com

Constant Flask Session IDs

。_饼干妹妹 提交于 2019-12-05 03:23:14
I've a Flask application, served with Nginx+WSGI (FastCGI & Gevent) and use standard Flask sessions. I do not use the session.permanent=True or any other extra option, but simply set SECRET_KEY in the default configuration. I do not save any (key,value) pairs in the session, and only rely on the SID = session['_id'] entry to identify a returning user. I use the following code the read the SID : @page.route ('/') def main (page='home', template='index.html'): if not request.args.get ('silent', False): print >> sys.stderr, "Session ID: %r" % session['_id'] I made the following observations: For