Forum Moderators: open
Will this suffice?
1. On user login
- store data in session vars
- duplicate data in cookies
- set cookie to expire within now +30mins
2. On all other pages
- refresh cookie to expire within now +30mins
3. On glabal.asa session_onstart()
- check for cookie
- if unexpired copy data to session vars
I cannot use a database for this purpose because of other technical concerns.
Your input will be much appreciated.
Iam using classic ASP, not .NET and I don't have any other control over the server because Iam on a shared hosting plan.
Follow-up related questions:
1. When a session gets dropped because the http request is routed to another server, another new session is created upon receipt of the request, right? I assume a new session is created in such case that is why I opted to put the cookie-verification code inside Session on_start() in global.asa
2. What is the correct syntax for putting expiration date/time in cookies in classic ASP and ASP 3.0?
Is this correct?
- Response.Cookies("myvar") = myvalue
Response.Cookies("myvar").Expires = #1/11/05 00:00:00 AM#
Thanks again.
Problem with reading the cookies at session beginning of the session is that the session times out, it doesn't end when the customer switches servers.
Here's the scenario:
Your client is started on Server1 (Session Started).
He bounces to Server 2 (Session Started).
He then bounces back to Server 1 again (within 20 minutes? = Session Continued).
You would never know that the customer had been on the other server unless you're reading his cookies everytime. So, I would not use session at all, and just read cookies when you need them, write to them when you need to.
I'd also look into another hosting company like tomasz said.