cookies

How to to store http-cookies between sessions

I'm developing an app that logs into a web site. To do this I use the HttpClient object. I noticed I could get all the cookies from the post requests with the HttClient.getCookieStore method, the question is however how I save these cookies so the next time the app is started, the user don't have to log in. I should also mention that w...

How do you determine cookies are disabled *without* javascript and *without* redirecting?

If I disable javascript and cookies, Amazon.com detects that cookies are disabled without a redirect. If you click the cart link, there's only a get on the cart page. I'm guessing amazon.com is most likely not using ASP.NET, but how would you accomplish detecting disabled cookies using ASP.NET without the use of javascript and redirect...

How do I set/get a cookie in django that is available if user is logged in AND logged out

I understand request.sessions dictionary and how to use this. However, it appears that values set using request.sessions is only valid while the user is logged in. I need to set a persistent cookie that lasts for a fixed time period and not dependent on whether the user is logged in or not. What I would like is to store a value for...

Is it safe to store OAuth WRAP access tokens in a cookie?

I'm planning to setup a website that would access an oauth wrap framework. I was thinking of storing the access token on the client machine as it is. I do NOT want to maintain a database of temporary tokens, etc on the server. Should I be doing do? Or should I encrypt it? What else do I need to successfully manage a non-database utilizi...

jQuery cookie expiration value

I have read a lot of jQuery cookie questions on here and know there is a jQuery cookie plugin (jQuery cookie). Without doing much investigation, the question: is there a way to determine expiration date of cookie? From the jquery.cookie doc: /** * Get the value of a cookie with the given name. * * @example $.cookie('the_cookie'); *...

Will ASP.Net MVC's AntiForgeryToken Method work with Load Balancers?

Using ASP.Net MVC v2.0, I am starting to research the use of the Html.AntiForgeryToken() method when submitting forms that process data. I can see it sets a hidden value in the form HTML and it sets the same value in a session cookie. The question is will different web servers in a load balanced configuration create the same token in t...

Is there a way to rename the RequestVerificationToken cookie name?

Using ASP.net MVC v2.0, Any way to change the name of the __RequestVerificationToken cookie? In an effort to conceal our underlying technology stack, I’d like to rename the cookie to something that can’t be traced back to ASP.Net MVC. More info on this at Steve Sanderson's blog. ...

How to add / edit a cookie in php?

I'm using the following functions to set an array of values in a cookie in PHP, but I also need an "add" and "edit" function - any suggestions on how I can do that? function build_cookie($var_array) { if (is_array($var_array)) { foreach ($var_array as $index => $data) { $out.= ($data!="") ? $index."=".$data."|" : ""; } ...

How does gmail keep a user logged in?

I wonder how gmail/Google keeps a user logged in even across sessions. And how (e.g. cookies) and what (e.g. time) do they use to decide to re-prompt the user for the login? ...

I have tried to login to facebook via curl,

I have successfully logged into facebook in this manner but cannot seem to keep the facebook logged in as soon as you click anything in facebook it redirects you to the login page. I pondered this + thought that it was due to the fact that curl was using the cookie + not the browser, thus when you click you are un - authenticated. is t...

Access Browser Cookies from Android App?

Is it possible to lookup native browser cookies in a custom Android App? I am not talking about WebView cookies. In my app I want to check if a user visited a website using the normal browser. Are browser cookies stored in a pubic directory somewhere on the device? ...

authCookie not secure in global.asax

I have a login problem. First i am using SSL while logging. When i log in, i am creating a cookie like this. when i check if it is secure the answer is yes. FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, // version UserName.Text, ...

Persisting a shopping cart in Ruby on Rails

Currently developing a shopping cart, the options for persisting the cart, as i see them are: Store the entire cart object in a sessions table. Store the entire cart object in a cookie session. Have a cart table, and store the cart id in a cookie session. Have i missed any? which is the best to roll with please? Thanks ...

Setting a cookie in an AJAX request?

Hi, I'm validating a login form with jQuery AJAX call to PHP. In php, I create a session and if they checked the 'remember me' checkbox, I want to create a cookie. Here's the php code: <?php include '../includes/connection.php'; date_default_timezone_set('GMT'); $name = $_POST['username']; $pass = $_POST['password']; $query = mysql_...

Implementing a generation of HttpSession key

I am trying to implement a generation of HttpSession key I am generating a random number between 1,000,000 to 9,999,999 and send it as a cookie to the user. Is it possible to make this process secure? anyone can make a random number like that and try to access my server...maybe I need larger range? another question is, how can I gener...

Android: log into website and preserve session/cookie using DefaultHttpClient

Hi, I've been through different tutorials and this website, but couldn't find a proper solution. On the other hand, I've seen apps logging into websites and requesting further information, so I'm sure there's a way to get this working, but maybe my approach is all wrong. Here's what I'm trying to do: I want to log into a website that n...

Security cookies ASP.NET

I've a code to persist information in cookies about users like UserName and password. Question is: Its not secure to store information like that plain text in cookies.My DB store hashed passwords,so i could save those hashs in cookies and retrieve them later,but if i do that i wouldnt be able to fill password's textbox cause the hash s...

Google Chrome Cookies - Broken for Virtual Hosts?

Hi.. I recently moved my development environment to my local machine (mac), and setup an Apache virtual host: dev-mysite so in the browser it's: http://dev-mysite/ No .com or anything like that issue I'm having now is that signing into the site requires setting a cookie and for some reason Google Chrome isn't letting my dev enviroment ...

Accessing session data with a session ID

I've been told that it is insecure to store things such as passwords, usernames, and user ID's in cookies, and that instead you should store a sessionID in a cookie. Here's where I get lost. My objective is to have a basic 'remember me' feature. Normally I would store user login information in a cookie, but as this is unsafe, I'm wonder...

How can I get a missing cookie with android ? In Firefox yes appear

I can get a cookie with firefox, but not with android. This is the code: HttpParams httpparams = new BasicHttpParams(); httpparams.setParameter(ClientPNames.COOKIE_POLICY,CookiePolicy.BROWSER_COMPATIBILITY); HttpGet httpget = new HttpGet(sURL); httpget.setParams(httpparams); httpget.setHeader("User-Agent","Mo...