homepage Welcome to WebmasterWorld Guest from 54.196.201.253
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP and Cookies
Hmmm Yum, Yum
knighty




msg:1249306
 4:46 pm on Mar 13, 2002 (gmt 0)

I have some pages that are password protected. I am doing this by detecting a a cookie and if that cookie is'nt available re-directs you to the login page.

When you log in I set a cookie like setcookie("user","itsme")

HOWEVER....

The cookie keeps deleting itself, I thought that if you did'nt specify a limit thenit would last forever.

 

sugarkane




msg:1249307
 4:51 pm on Mar 13, 2002 (gmt 0)

It's the other way around - if you don't specify an expiry time, the cookie lasts for just that session. If you want an 'infinite' cookie, set it to +999 days or something ;)

knighty




msg:1249308
 9:15 am on Mar 14, 2002 (gmt 0)

Aha!

thanks Sugarkane, don't know why I thought the opposite.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved