cookies

Symfony2 : remember me cookie gets deleted when reopening the browser

一个人想着一个人 提交于 2020-01-02 07:46:51
问题 Despite of all the other questions on stack-overflow I was not able to resolve the issue with all the provided information. That's why I decided to create a new one. So I am implementing the remember me function in my login form with a checkbox that looks the like this: <input type="checkbox" id="form_saveCredentials" name="form[saveCredentials]"> On login everything looks fine and the cookie gets set correctly Through the whole browser session the cookie remains alive. But when I close the

session_regenerate_id() doesn't work in IE11/Edge

北战南征 提交于 2020-01-02 07:46:09
问题 I have standard authentication situation... Visitor fills login+password to form, php script authenticates it in database a redirects back to some page. In this process, we just add session_regenerate_id(true) when the customer is successfully authenticated just before the redirect. Everything works fine in Chrome, but it doesn't work in some versions (not all) of IE11 and latest version of Edge (tried in virtual box - download from modern.ie). Maybe it doesn't work in some other browsers.

Puzzled by CookieHandler

耗尽温柔 提交于 2020-01-02 07:45:29
问题 I need to access some web pages and pass cookies around the way browsers do. This is easily done using CookieHandler.setDefault(new MyCookieManager()); but this introduces global state which I need to avoid (Imagine accessing two accounts on the same server concurrently). So what I'd like to do is something like String doGetWithCookies(URL url, MyCookies myCookies) { HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); myCookies.addToRequest(...); myCookies.updateFromResponse(

Accessing cookie expiration time owin

夙愿已清 提交于 2020-01-02 07:11:22
问题 I am trying to access expiration time on Owin i am using the following example Access ExpireTimeSpan property of Owin Cookie Authentication to notify user of login expiry but i cant get to work. I get an error the key, value does exist. I would really appreciate if someone could point me to the right direction thanks. StartupAuth.cs var config1 = new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, //LoginPath = new PathString("/Account/Login"),

JSP Redirect: Session Loss Issues

折月煮酒 提交于 2020-01-02 07:00:10
问题 Having replaced a <jsp:forward page="URL"> with a response.sendRedirect("URL"); , I find I know lose the session once the redirect occurs. Is there a way to preserve the session with a redirect, or to reconstitute the session cookie and send it along with the redirect? I know I could use JavaScript via window.location = "URL"; , but that is far from ideal! Any help? 回答1: You should not have to resend the cookie, because if you had a session established, the cookie should already be on the

How do I manually add more cookies to a session which already has cookies set in mechanize?

僤鯓⒐⒋嵵緔 提交于 2020-01-02 04:42:09
问题 I have a python script which scrapes a page and receives a cookie. I want to append another cookie to the existing cookies that are being send to the server. So that on the next request I have the cookies from the original page plus ones I set manually. Anyway of doing this? I tried addheaders in mechanize but it was ignored. 回答1: Use the set_cookie method: >>> import mechanize >>> br=mechanize.Browser() >>> br.set_cookie? Definition: br.set_cookie(self, cookie_string) Docstring: Request to

Puppeteer get 3rd party cookies

那年仲夏 提交于 2020-01-02 04:34:09
问题 How can I get 3rd party cookies from website using puppeteer? For first party I know I can use await page.cookies() 回答1: I was interested to know the answer so have found a solution too, it works for the current versions of Chromium 75.0.3765.0 and puppeteer 1.15.0 (updated May 2nd 2019) . Using internal puppeteer page._client methods we can make use of Chrome DevTools Protocol directly: (async() => { const browser = await puppeteer.launch({}); const page = await browser.newPage(); await page

not getting all cookie info using python requests module

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 03:43:06
问题 I'm learning how to login to an example website using python requests module. This Video Tutorial got me started. From all the cookies that I see in GoogleChrome>Inspect Element>NetworkTab, I'm not able to retrieve all of them using the following code: import requests with requests.Session() as s: url = 'http://www.noobmovies.com/accounts/login/?next=/' s.get(url) allcookies = s.cookies.get_dict() print allcookies Using this I only get csrftoken like below: {'csrftoken':

ASPXAUTH cookie is not being saved

久未见 提交于 2020-01-02 03:41:26
问题 Im working on a web project in ASP .NET MVC 2. In this project we store some info inside an ecripted cookie (the ASPXAUTH cookie) to avoid the need to query the db for every request. The thing is the code for this part has suddenly stopped working. I reviewed the changes made to the code on the source control server for anything that could be causing it, I found nothing. I even reverted to a known working copy (working on some other persons PC, same code, etc) but after debugging, it seems

What exactly is session_id( ) and session_name( )? Explain how they are being used in the following code

[亡魂溺海] 提交于 2020-01-02 02:42:05
问题 ?php function destroy_session_and_data() { session_start(); $_SESSION = array(); if (session_id() != "" || isset($_COOKIE[session_name()])) setcookie(session_name(), '', time() - 2592000, '/'); session_destroy(); } ?> I understand the above code is used to terminate a session but I cant understand the need for the if condition and the setcookie command. Also could you please explain what exactly is session_id() and session_name(). A clear explanation would be most appreciated. Thanks 回答1: PHP