Date:  11/05/2002 08:51:57 AM Msg ID:  000985
From:  Jeff Grippe Thread:  000985
Subject:  Cookies not kept when brower closed
I am trying to use cookies to store some information that can be used to restart a session that has timed out (if there's a better way I'm willing to hear that as well).
 
When the user is working on something that might need to be restarted there are 2 things I need to know: ReqTable (the database file) and Batch (an internal Batch number). My design is as follows:
 
 
When a Batch is opened I call:
 
Response.SetCookie("ReqTable", ReqTable, date() + 10)
Response.SetCookie("Batch", TheBatch, date() + 10)
 
 
When a Batch is finished normally I call:
 
Response.DelCookie("ReqTable")
Response.DelCookie("Batch")
 
 
After My Login Screen I do:
 
ReqTable = Request.GetCookie("ReqTable")
Batch = Request.GetCookie("Batch")
if not empty(ReqTable)
     * set some session variables
     Response.Redirect("NewRequest.FWX")
endif
 
 
For Debugging I put the following in my main screen:
 
<h3><%=Request.GetCookie("Batch")%></h3>
 
 
If I create a new batch and add a few line items I observe the following:
 
1. If I then hit the button to return to my home page (which is outside of the FoxWeb based site) and then return to my site and login, the code above works fine and I am returned to editing the batch.
 
2. If I close the browser, open it again, and then go back to the site and login it does not see the cookies.
 
I'm using IE 6 SP 1 and I changed the privacy settings to "Allow All Cookies" before I started this testing.
 
Thanks,
 
Jeff Grippe