Laravel is running on my server which is set to a UTC timezone. PHP's timezone is also set to UTC.
When a user comes in, no matter where is she from, a cookie is set with and absolute date relative to server's time:
Set-Cookie my_app_session=XXX..XXX%3D; expires=Sun, 21-Sep-2014 09:57:16 GMT; path=/; httponly
This is a total fail for a user who is from, say, UTC+7 – if she's on Safari or other browser that takes cookie expiring time seriously, the cookie is not saved, session is not kept till next request, even if its an ajax call within a second after.
How can I tweak this behavior to set expiring time in seconds after the cookie has been set, or make it a session cookie with no expire parameter?
Apparently, setting
'expire_on_close' => true,
in app/config/session.php solves the issue.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community