cookies

Handling CSRF protection when cookies are disabled

Without cookies enabled, a form post will throw ActionController::InvalidAuthenticityToken. For the most part, I just handle the exception with a message stating that cookies are required to login to my application. However, one thing users of my application can do is create content to be shared with other people, who may or may not be ...

invalidate a cookie on password change

I use cookies to manage user sessions in my Rails app. I recently found that when a user changes the password, the cookie does not get invalidated as expected. As you realize, this could be a great threat to security. How should I handle this problem? I want to expire or invalidate a cookie once the user changes the password. How do I do...

Fetch cookie set by header

Hello, I login to a website and it returns a cookie via the header. The cookies name is fb_cookie. I try to read it with the below PHP code but it returns nothing. How can I fetch a cookie set via the header? echo $_COOKIE["fb_cookie"]; The response is this from the header (read by the Poster plugin in Firefox). fb_cookie=1554e662b9...

Bookmarklet to make session cookies expire later

Background: There are several sites that I visit regularly on my iPhone that require me to log in. Unfortunately, the sites set cookies that expire at the end of the session. This unfortunately means I end up having to log in up to a dozen times per day. I would like to write a bookmarklet that will go through and change all my 'expires...

PHP + Javascript - Read/Write Cookies

Is it possible to create a cookie with javascript and then read it with PHP? And What about the other way around? ...

Pass a session from gwt into an iframe

Hi , I am working on a website built using GWT.Now i have an Iframe which actually opens up another website( for example say a Forum).Now all i want is a Single Sign On .That is once the user log's in into my system he is also automatically signed in into the forum and he can access the form with his username. Now the forum is actually ...

location of firefox source code that parses Set-Cookie header?

Can someone please point me to the Firefox source code where Set-Cookie header is parsed? I want to understand the exact behavior. Read further if you want to know why? For various constraint in my application, I need to pass multiple cookies inside single Set-Cookie header. RFC-2109 clearly mentions, "Set-Cookie response header com...

Cookie blocked/not saved in IFRAME in Internet Explorer, Part 2, p3p policy cannot fix it.

I have a similar problem as stated in http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer, I tried the approaches suggested in the several solutions suggested. But I still could not save cookies from a website of one domain such as example.com (as we have used this name in the original questi...

How to pass the cookies from GET to POST on iPhone

Hi, everyone, I want to ask an iPhone application, it is about the adding cookies of GET and POST in NSURLRequest and NSURLResponse. In my program, the user has to enter uesrname and password. After entered the information, the user will press a button. When the user presses the button, the program will call a function 'pressLoginButt...

Copying cookies from main domain to subdomain

My application has a userspace which used to be accessed by a url like domain.com/~username, but I am in the process of converting that to using subdomains instead (username.domain.com). However, I am running into an issue that I'm hoping someone might have an idea of how to get around. Currently, visitors to a user's site get a cookie ...

Forms Auth premature cookie expiration

Hi, I'm having trouble with a site that just went to production. For some reason, although the settings seem to be correct for a 15 minutes session timeout, users are reporting that in about 5 minutes they have to log in again. What can I check? how can I troubleshoot this? I can't reproduce it locally, or in our QA environment. Are the...

auth problems (security filters) in sfGuardUser Symfony

Hi, I'm using Symfony 1.2.7, and sfGuardUser Plugin. I'm able to view all the pages, login and logout. However when I try to edit (just going to the form) or update an object (saving the changes) sometimes I have problems of auth, and symfony redirects me to the edit form page again. I put some emphasys on sometimes because it's what it...

ASP.NET/JavaScript: Remove all cookies

How can I remove all my site's cookies from the client, either in ASP.NET/C# or JavaScript? Basically I would like to click a button or link on the page and have it clear all the cookies for the site. I don't need to know the name of every cookie, do I? ...

setting cookie and then redirection

hi! Ive designed a login form in php where the script sets a cookie and then redirects the the user to another page. But it shows the error Warning: Cannot modify header information - headers already sent by How can i overcome this? Please help. Thanks ...

get infos from __utmz Google Cookie and send it via Email

Hi I got a ASP file and would like to get infos from __utmz Cookie and forward it with mail. I use this code: <script language="javascript" type="text/javascript"> // // Get the __utmz cookie value. This is the cookies that // stores all campaign information. // var z = _uGC(document.cookie, '__utmz=', ';'); // // The cookie has a numb...

Cookies in ASP.Net

I set a cookie like this in one page: Request.Cookies["lang"].Value = "en-US"; Request.Cookies["lang"].Expires = DateTime.Now.AddDays(50); On another page I try and read the cookie: string lang = Server.HtmlEncode(Request.Cookies["lang"].Value); The cookie is not null but the value is an empty string. What am I doing wrong? ...

Using brackets in cookie names (Rails)

When attempting to write/read cookies that have brackets in the name, it seems like Rails can't handle this. For example: cookies["example[]"] = "value" This causes the cookie name to be "example%5B%5D" instead of "example[]". Similarly, if I already have a cookie set with the name "example[]", then it seems like Rails is unable to ...

IPhone: NSHTTPCookie wont set

I do this, but the new cookie doesn't show up, just some other cookies that are already set. What's wrong? [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:[NSHTTPCookie cookieWithProperties:[NSDictionary dictionaryWithObjectsAn...

Retrieving Cookie values from different domain

Hi! I have a site for example mysite.com which store a cookie when user enter etc. But my search page has a different subdomain/domain search.mysite.com. How do I retrieve the cookie from mysite.com? when i try to retrieve the cookie using the google search appliance . it gets me the cookie for search.mysite.com. I need the cookie va...

Why does SetCookie have to be called at the Beginning of an HTTP Response?

while reading about cookies i found difficulty to grasp the following statement "setcookie() must be called before any output to the HTTP response. The main reason is that PHP is not buffering the HTTP response" please help me to interpret it in easy way ...