cookies

How to test whether a browser accepts cookies with JavaScript?

I want to test with JavaScript whether the browser supports cookies or not. The following code works with Internet Explorer 8 and Firefox 3.6 but not with Google Chrome 5. function areCookiesEnabled() { document.cookie = "__verify=1"; var supportsCookies = document.cookie.length > 1 && document.cookie.indexOf...

How to store and optimize large values in cookies

I need to store the user preferences in a cookie. I have three multiple select drop downs & date. User is allowed to select all the values in dropdowns. If I store all the unique (8 characters) values in a cookie, then it will get overloaded. I need a mechanism to do some mapping so that minimal value is stored in cookie. My require...

cookie is not creating in IE6 through ASP Classic

Hi, I am writing a cookie in ASP Classic Page like Response.Cookies("FName")="John_kate" and immediately redirecting from that page to another page Response.Redirect("http://www.mydomain.com"). But after redirecting if I check the cookie, I cannot see the cookie. I checked in the Mozilla Firefox, In this browser I am able to see the co...

Are cookies created in ASP.NET bound by session timeouts?

If I create a cookie (in ASP.NET) like this cookie = new HttpCookie("MyCookie"); cookie["foo"] = "bar"; Response.Cookies.Add(cookie); will the value be empty/null if the session expires? My goal is to persist the data in the cookie only while the browser remains open even if the user is not actively interacting with the application. ...

iphone nsurlconnection read cookies

Hello I am using async NSURLConnection to connect to a web site from iPhone. Handle didReceiveResponse is activated on response and I am trying to get all cookies, by using allHeaderFields from NSHTTPURLResponse I see many hreader, but no Set-Cookie - it looks like iphone simulator just ignores them... And I am sure cookies are present...

How to cross-domain identify a user with third-party cookies ?

Hello, I am doing an internship in an ad-targeting startup. We have publishers in our network that can display ads we send them. Currently our system is able to analyze the behaviour of a user whenever he visits one of our publishers. On the publisher's site, some javascript code creates a user ID. This javascript code stores the user...

How to use same cookies in multiple request in python?

I am using this code: def req(url, postfields): proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:8118"}) opener = urllib2.build_opener(proxy_support) opener.addheaders = [('User-agent', 'Mozilla/5.0')] return opener.open(url).read() To make a simple http get request (using tor as proxy). Now I would like to ...

what is the functionality behind the gmail and orkut login?

When I sign in in gmail and I open orkut in the new tab or new window then automatically I am signed in in orkut without entering username and password. How this functioanality works..? And when I sign out from either site, I am signing ou from other site also.. is it done by session handeling or by cookies..? what is the mechanism behi...

Really weird Cookie header behaviour? - Cookies

Hi folks, I'm using Firefox 3.6.8 for these tests. I'm setting a cookie within the response headers of my web app using: Set-Cookie: session=7878dfdsfjsdf89sd89f8df9 This does not seem to override the session Cookie. When a request is performed instead Firefox even sends duplicate cookies: Cookie: session=7d75cd8f55895cbccb0d31e...

Proxy server for logging in.

Hello, I'm writing a proxy script that ideally does the following things: Proxy waits for request for certain protected pages from end user Posts login information to page. The login information is hidden to the end user. Proxy reads the 'set-cookie' response from the server and 'hands off' this cookie to the end user. At this point...

Better to get value from PHP variable or from cookie?

Assume that there is a PHP variable: $variable = 'username'; cookie value = 'username' Which one is better to access? get_cookie() or just use $variable? I have a lot of code using get_cookie('cookie_name') (a CodeIgniter function) instead of using variables. Will it increase performance if I change it to access $variable instead of...

Running a query multiple times vs using a cookie

A question about query/database performance: I have a table that records how many “points” a user has earned. There is 1 row for every 1 point. When someone gains 20 points, 20 rows are inserted into the database. When someone looses 20 points, I will add a row with the value of “-1” in the database. Thus the number of points someo...

Disable Cookies Inside A Frame/Iframe

Hi! Is there any way to programatically disable cookies being created by a page displayed inside of a frame/iframe? Or to generalise further, is it possible to programatically disable javascript running on such a page? Thanks, DLiKS ...

File Upload and Cookie

Hello I am working on multi step registration form and it contains file uploads in the intermediate step . I am storing each value in the form in the cookie to work it with browser back button and and reset the same in the final form which i want to post at the. But how to store the file upload in the cookie so that i can set it when use...

What is the C# equivalent of this PHP cookie parsing snippet?

I'm trying to convert this PHP cookie parsing snippet into C#, but my PHP is a bit rusty. It's taken from a facebook SDK sample. <?php define('FACEBOOK_APP_ID', 'your application id'); define('FACEBOOK_SECRET', 'your application secret'); function get_facebook_cookie($app_id, $application_secret) { $args = array(); parse_str(t...

Can an AJAX response set a cookie?

Can an AJAX response set a cookie? If not, what is my alternative solution? Should I set it with Javascript or something similar? Thanks, Billy. ...

How can I set a cookie in a request using Fiddler?

I need to set a cookie before I issue a request to a Web site using Fiddler. How do I do this? ...

Check session and cookie not working in PHP

I have this code that makes sure your are logged in, and then making sure you are on the right page by checking a cookie set at login. This code works on a page in a directory underneath the login in script, however in a page in a directory below that it always takes you to accessdenied. Any ideas? <?php session_start(); if(!isset($_...

Admins having to reload page to see admin features (question about cookie location)

I am creating a custom cookie and have overloaded the Iprincipal class and all that good stuff. My cookie works correctly and I am able to retrieve the roles of the users successfully, but the admins have to reload the default page after just logging in to see the admin only button. Once they visit a new page on my site and return to the...

Saving form state after a page refresh

I have a list of checkboxes. If the page is refreshed before the user submits the form, I want the state of the checkboxes (checked or not checked) to be preserved. Ie: user selects option 1, option 4 and option 5. The page refreshes and option 1, option 4 and option 5 remain checked. I have looked into serialising then storing a cook...