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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookies - setting "expires"

Status
Not open for further replies.

c4n

Programmer
Mar 12, 2002
110
SI
Hi!

I wrote a script that uses cookies and I use a redirection page to set them with the following header:

<META HTTP-EQUIV=&quot;Set-Cookie&quot; CONTENT=&quot;my_cookie=test&quot;>

All works fine.

The problem is when I try to setup &quot;expiration time&quot; it works only when I set an absolute date like:

<META HTTP-EQUIV=&quot;Set-Cookie&quot; CONTENT=&quot;my_cookie=test; expires=Friday, 29-Dec-02 23:59:59 GMT;&quot;>

BUT not if I set &quot;expires&quot; to relative time (like +1H).

How do I set the header so it will set cookie to expire after (let's say) 1 hour?

Thanks in advance.
 
simplfy your life and use the CGI.pm module it will convert you values for you to a proper format and elminate brain cycles. Best to waste a few computer cycles than brain cycles.

Referr to the FAQ there is one specifically about cookies and CGI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top