PDA

View Full Version : Cookie Expiration Date


CdnGal
11-24-2002, 06:57 AM
Hi, there

I am learning Javascript and ASP. I am working on a project in one of the books (it's an asp file, as instructed by the book) and it is asking to put a cookie expiration date of 7 days from now (not a specific date). Is there an EASY way to do this (I saw in the book that in VB it looks like it's simply Response.Cookies ("x").expires = Date + 7

But that's VB....

It appears I'm not so lucky as to have this work for me for this project, but worth a shot anyway! hee hee...Anyway, I've been searching the web, as well as this site, but can't really understand it. Is there any easy one-liner that will do this, as all the ones I've seen are decaring variables etc. and look quite complicated.

Thanks for the help!

whammy
11-24-2002, 12:31 PM
Found the answer with a google search (I use VBScript with ASP, and use javascript only for client-side stuff, since you will find MUCH more documentation on ASP/VBScript!):

http://bugpower.dyndns.org/pavel/Stuff/techres/cookies.htm

:)

CdnGal
11-25-2002, 02:06 AM
Thank you! That was what I was after! All my searches ended up with much more information that just seemed like a bit much for simple cookie!

Have a great day.

whammy
11-25-2002, 02:12 AM
No problem... by the way, in classic ASP, (that's what they're generally calling it now that .NET is out), you can use JScript and VBScript interchangeably on the same page, i.e. on your js page:

<script language="VBScript" runat="server">
'VBScript code here
</script>

:)