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!

Cookie expires when close the Browser

Status
Not open for further replies.

cmartins

Technical User
Oct 16, 2001
8
BR
Hello

How expires a cookie when the browser is closed ?


Regards
cmartins
 
Hi

The browser itself deletes the cookie if there is no expiry time when it closes. This is a browser function not PHP.

Cheers
Richard
 
setcookie('name', $value) will set an sessiononly cookie
setcookie('name', $value, time() + 84600) will set an cookie for a day.
When setting the time (the third option) to a date in the past, the cookie will never expire. mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top