Solved

Cookies are being expired after application pool is recycled

Posted on 2007-03-29
2
413 Views
Last Modified: 2013-11-07
I have an .NET 1.1 application running under an IIS 6.0.  This application makes use of  "Remember Me" option to save a persistant cookie so that the user doesn't need to login all the time.  This works completly fine and has been for many years on many differernt servers, but I just deployed this application to one client's computer and now, whenever the application pool recycles, the user's cookie isn't being used to log them in again, in essence, the cookie acts like it's expired or non-existent.  The IIS settings on this server and another server which works fine are completly the same and the web.config files are exactly the same.  I know the cookie still exists, and I can test that by closing my browser and going back to the site where I am logged back in automatically again using the cookie.  The only time that the cookie is not being accepted is if the application pool is recycled, even if I am in mid-session.  What would cause this one server to not accept valid cookies for logging in users after the session expires?  Any help is appreciated.
0
Comment
Question by:bmccleary
2 Comments
 
LVL 12

Accepted Solution

by:
craskin earned 500 total points
ID: 18820452
you need to compare the machine.config files. if you're encrypting your cookies, the keys are refreshed when the app pool recycles. my guess is your old machine had static keys for the decryption.
0
 

Author Comment

by:bmccleary
ID: 18824173
Thanks Caskin, we figured out that Windows Server 2003 SP2 was the culprit.  All the other servers were SP1.  With SP2, it causes the encryption key to be changed with each recycle.  We added a value to the web.config to make the keys static.  Thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now