Re: Cookie ?

From: Date: Thu, 31 May 2001 02:52:28 +0000
Subject: Re: Cookie ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55708@lists.php.net to get a copy of this message
i had this problem a while back. the problem with this is cookies work by the users time not the servers time. so if the server is in america and my computer is on japanese time even a cookie set for time()+18000 will be valid because my computer is actually +50400 for a server in EST. i have have worked with two alternatives here. one set another cookie that holds a timestamp of the time you want the other cookie to expire and then compare server time and the expiration cookie. or do the same thing basically b ut use a variable set in a session. Thank You, Jon Yaggie www.design-monster.com And they were singing . . . '100 little bugs in the code 100 bugs in the code fix one bug, compile it again 101 little bugs in the code 101 little bugs in the code . . .' And it continued until they reached 0 ----- Original Message ----- From: "Jack Sasportas" <jack@innovativeinternet.com> To: "php" <php-general@lists.php.net> Sent: Sunday, July 01, 2001 9:44 AM Subject: [PHP] Cookie ? > I wanted to do something like set the cookie for 5 minutes, then as the > user uses the system each page would refresh so to speak the timeout > always setting it back to 5 minutes as long as he was using it. > I beleive this is not really working. > Any Ideas on how I can accomplish this ?? > > Thanks > Here is the function I was using to set the cookies... > > > function f_put_cookie($user_name,$user_email,$account_type) { > > global $HTTP_COOKIE_VARS; > > if(isset($c_user_name)) { > > > setcookie("c_uas_time","GREEN",(time()+400),'/','website.com',0); > } else { > > setcookie("c_user_name",$user_name,(time()+400*30*12),'/','.website.com',0); > > > setcookie("c_user_email",$user_email,(time()+400*30*12),'/','.website.com',0 ); > > > setcookie("c_account_type",$account_type,(time()+400*30*12),'/','.website.co m',0); > > setcookie("c_uas_time", > "GREEN",(time()+400),'/','.website.com',0); > } > } > ___________________________________________________________ > Jack Sasportas > Innovative Internet Solutions > Phone 305.665.2500 > Fax 305.665.2551 > www.innovativeinternet.com > www.web56.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#55708) next »