Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 19th, 2004, 12:22 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to chrisneozion12 Send a message via Yahoo to chrisneozion12
Default asp cookies expire

how do u make a cookie expire?
i tryied this:
<%
Response.Cookies("Name")="Me"
Response.Cookies("Name").Expires = -1000
%>
i want to make it expire after about 5 minutes, not a set date
aim=bleachedchris
yahoo im and email = [email protected] or chrisinthematrix
 
Old January 19th, 2004, 12:32 PM
Authorized User
 
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Having it expire in -1000 is basically used to remove an existing cookie or to account for time differences...If you are trying to "timeout" a site use the session.expires method...set it to 5 on the index.asp page

<%
session.expires=5
%>

All other session variables will clear once the session itself expires

Let me know if this helps

John

 
Old January 19th, 2004, 03:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You would still use a set date (and time), but you set the datetime to 5 minutes from now. Of course, this is kind of difficult when you consider that A)The server time and client time would need to match reasonably closel and B)If the client is not in the same timezone, the cookie expiration would be off by 1-24 hours.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Vs ASP cookies mikedeepak Classic ASP Professional 1 June 19th, 2006 12:25 PM
Problem with ASP Cookies crobarian Classic ASP Components 3 June 24th, 2005 02:10 AM
ASP Cookies Question khng ASP.NET 1.0 and 1.1 Basics 2 March 6th, 2005 09:05 AM
cookies in asp.net Asteroid ASP.NET 1.0 and 1.1 Basics 1 September 22nd, 2004 07:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.