Hi everybody,
Subject: Setcookie expiration time.
Goal: To expire the cookie after 15 minutes (900 seconds) from setting.
Problem Description:
- When I set the expire parameter to time()+900, its taking the server timestamp where its in my case (time in GMT + 900).
(i.e. timestamp is 09:00AM GMT + 900 seconds -> expire at 09:15AM).
- If the user who is surfing my site is living in a country which its time is GMT+2, the cookie will not set (as I'm testing!) since the expiration time is in the past.
(i.e. User current loacl time is 09:00AM GMT + 2 -> 11:00AM) and the expire time of the cookie is 09:15AM as its returned from the setcookie function, which is in the past with respect to the user's browser local time.
Question:
- How can I overcome this problem? Since the user that surfing my site can be in any country in the world with its time is GMT+(X)hours, not necssary having the same server time. How can I set the cookie to the user's local time not the server time?
Please help my guys Im stucked
Subject: Setcookie expiration time.
Goal: To expire the cookie after 15 minutes (900 seconds) from setting.
Problem Description:
- When I set the expire parameter to time()+900, its taking the server timestamp where its in my case (time in GMT + 900).
(i.e. timestamp is 09:00AM GMT + 900 seconds -> expire at 09:15AM).
- If the user who is surfing my site is living in a country which its time is GMT+2, the cookie will not set (as I'm testing!) since the expiration time is in the past.
(i.e. User current loacl time is 09:00AM GMT + 2 -> 11:00AM) and the expire time of the cookie is 09:15AM as its returned from the setcookie function, which is in the past with respect to the user's browser local time.
Question:
- How can I overcome this problem? Since the user that surfing my site can be in any country in the world with its time is GMT+(X)hours, not necssary having the same server time. How can I set the cookie to the user's local time not the server time?
Please help my guys Im stucked
