Forum Moderators: open

Message Too Old, No Replies

Very Basic Stuff

cookies

         

cmatcme

1:52 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



I have read up alot on cookies recently and found out the following attributes:

response.cookies
request.cookies

And all the things about them (naming them, expiring them etc). One thing that would be quite useful for my users is to end their session on my site (which are controlled my the cookies) by deleting them.

How would remove the cookies thus ending their session?

cmatcme

8:55 am on Mar 27, 2005 (gmt 0)

10+ Year Member



Found out how. Just overwrite them with a dated expiry date!

response.cookies ("name") = "delete"
response.cookies ("name").Expires = #Jan 1,2005#

Deletes as soon as it is produced!

mattglet

2:58 pm on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also set the cookie to be a blank value...

'Beginning of session:
Response.Cookies("name") = strNameVariable

'----------- user has fun in their session...

'End of session:
Response.Cookies("name") = ""

This will clear out the value of the name cookie. So the next time you check the cookie, there will be nothing there, so that means their session will be dead.