Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookie Expiration

Status
Not open for further replies.

BenRussell

Programmer
Mar 12, 2001
243
US
I need to set a cookie (without using a module since the script will be used on multiple servers). I wanted to use the

print "Set-Cookie: Information=$Information; expires=WHENEVER; path=/\n";

but I need to know how to set the expiration to either, 1 hour, 1 day, 1 week, or 1 month

do i just use instead of "WHENEVER", "+1h, +1d, +1w, +1m" not all at once, but you know what i mean.

Thanks. - Ben Russell
- President of Intracor Technologies (
 
This should work:-

print "Set-Cookie: Information=$Information; expires=Thu, 31-Dec-1998 00:00:00 GMT\n";

obviously the date is just an example of the required syntax

Good Luck

Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top