Print Page | Close Window

Deleting Cookie when ASP Session Expires

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=26185
Printed Date: 29 March 2026 at 2:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Deleting Cookie when ASP Session Expires
Posted By: jadam
Subject: Deleting Cookie when ASP Session Expires
Date Posted: 29 August 2008 at 8:42pm
I have my website set to timeout at 20 minutes using the Session.Timeout=20 on the main index.asp page.
 
When the user logs into the website they are automatically logged into the forum using the forum API.
 
I've noticed that the ASP session will timeout properly but the user can still access the forum as the cookie is still active.
 
Is it possible to check to see if the session has timed out and force the cookie to delete (and log the user out of the forum)?
 
Something like (psydo code)
 
If Session = unactive Then
response.redirect = "forum-logout.asp"
End IF
 
I have an ASP page that if the user clicks the link "Log Out" it closes the session and runs the code to delete the cookie.
 
 
Thanks,
Joe



Replies:
Posted By: shakir
Date Posted: 10 September 2008 at 10:30am
If Session ("name")= "" or  Session ("name")=null  Then
response.redirect = "forum-logout.asp"
End IF


Posted By: bapsbps
Date Posted: 07 March 2009 at 1:12pm
In ASP Cookie and Session are two separate thing.


-------------




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net