View Full Version : Get and Set Cookies
04-04-2003, 08:49 PM
Can someone answer this or point me to a source of info? How do you save a cookie to the user's computer and how do you read that cookie when they open the web site?
04-04-2003, 08:55 PM
Try a basic search...
04-04-2003, 10:06 PM
// This goes before the <html> tag
// time() + 3600 is the expiration. time()+3600 would be 1 hour ( 3600 seconds )
That would set a cookie to the users computer, that would last the set time. To display the contents of the cookie, you need to use $HTTP_COOKIE_VARS ( or $_COOKIE )
// an example, set a cookie then get its value
// sets a cookie called name, with a value of matt that lasts 5 minutes.
// would write matt on to the page.
04-05-2003, 12:04 PM
Thanks a lot for the answers.
04-05-2003, 12:10 PM
no prob :thumbsup:
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.