Attempt to enable persistent sessions
This commit is contained in:
parent
c86865bc61
commit
3caa71a6c5
1 changed files with 11 additions and 13 deletions
24
index.php
24
index.php
|
@ -42,20 +42,18 @@ spl_autoload_register(
|
|||
*/
|
||||
$sessionLifetime = 2592000 * 12; // 12 Months
|
||||
|
||||
session_set_cookie_params($sessionLifetime, '/');
|
||||
session_start();
|
||||
|
||||
/** Refresh lifetime */
|
||||
$session = session_get_cookie_params();
|
||||
|
||||
session_start(
|
||||
array(
|
||||
'name' => 'wishthis',
|
||||
'cookie_lifetime' => $sessionLifetime,
|
||||
)
|
||||
);
|
||||
setcookie(
|
||||
session_name(),
|
||||
session_id(),
|
||||
time() + $sessionLifetime,
|
||||
$session['path'],
|
||||
$session['domain'],
|
||||
$session['secure'],
|
||||
$session['httponly']
|
||||
name: session_name(),
|
||||
value: session_id(),
|
||||
expires_or_options: time() + $sessionLifetime,
|
||||
path: '/',
|
||||
domain: ''
|
||||
);
|
||||
|
||||
/** Backwards compatibility */
|
||||
|
|
Loading…
Reference in a new issue