cookie expires frequently
Posted: Fri Jun 19, 2009 1:47 am
Hi
I am using cookie (instead of session) for authentication in my site. the site is hosted in a server inside USA. Now whenever a person access the site from outside USA, we notice a frequent cookie timeout issue. we are setting the cookie using the following lines.
setcookie($this->token_name, $token,time()+1800, '/');
So we assumed that the issue happened due to time difference between the server and the client browser(since the client is outside USA). we tried changing the expire parameter to <clienttime>+1800 instead of time()+1800. Also tried stetting the parameter to 0. Nothing works the cookie expires after a few minutes/seconds compelling the user to log in again. Please help if anyone has an idea.
Thanks
I am using cookie (instead of session) for authentication in my site. the site is hosted in a server inside USA. Now whenever a person access the site from outside USA, we notice a frequent cookie timeout issue. we are setting the cookie using the following lines.
setcookie($this->token_name, $token,time()+1800, '/');
So we assumed that the issue happened due to time difference between the server and the client browser(since the client is outside USA). we tried changing the expire parameter to <clienttime>+1800 instead of time()+1800. Also tried stetting the parameter to 0. Nothing works the cookie expires after a few minutes/seconds compelling the user to log in again. Please help if anyone has an idea.
Thanks