Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is possible to keep session even after the browser is closed?

Tags:

php

session

Could anyone tell how to maintain a session (in PHP) so that the session contains are preserved and are accessible even after the browser is restarted.

In general a session expires with the closing of a browser, but I want the session NOT TO BE CLOSED so that the session data's can be accessed the next time the browser is used.

like image 484
Octavian Avatar asked Sep 10 '10 12:09

Octavian


1 Answers

Use session_set_cookie_parameters() to give the session cookie a non-zero lifetime before starting the session, or set session.cookie_lifetime to non-zero.

like image 166
Ignacio Vazquez-Abrams Avatar answered Oct 13 '22 00:10

Ignacio Vazquez-Abrams