Re: Re: Question about cookies

From: Date: Thu, 13 Jul 2000 12:09:30 +0000
Subject: Re: Re: Question about cookies
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6417@lists.php.net to get a copy of this message
Hi, Sorry about replying so late, been busy with other things. Long ago, Stephen Cope wrote: > : > * if there is no cookie, remove their login details > : > * if there are no login details, as for their login details > : > * store a cookie > : > : That's right! > : This works, thank you... but where is checked now if the cookie exists, > : and are the login details resetted when there's no cookie present? > Well simply, your algorithm doesn't make sense. > Think about this: > * if there is a cookie set, then the login details will not be reset > * if there is a cookie set, login details are not needed > * if there is no cookie, login details will be reset > * if there are login details, a cookie will be set > You do realise that with your code it is *impossible* for a cookie to be > ever set? What I want to do is this: - user logs in; cookie is set (with expire time) - every time the page is requested, check if cookie still exists if exists -> grant access if gone -> re-ask login and password Can you please give me a hint how to create something like that? TIA, Pieter

« previous php.general (#6417) next »