Solved

Cookies are being expired after application pool is recycled

Posted on 2007-03-29
2
417 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

679 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