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
|
$sessionLifetime = 2592000 * 12; // 12 Months
|
||||||
|
|
||||||
session_set_cookie_params($sessionLifetime, '/');
|
session_start(
|
||||||
session_start();
|
array(
|
||||||
|
'name' => 'wishthis',
|
||||||
/** Refresh lifetime */
|
'cookie_lifetime' => $sessionLifetime,
|
||||||
$session = session_get_cookie_params();
|
)
|
||||||
|
);
|
||||||
setcookie(
|
setcookie(
|
||||||
session_name(),
|
name: session_name(),
|
||||||
session_id(),
|
value: session_id(),
|
||||||
time() + $sessionLifetime,
|
expires_or_options: time() + $sessionLifetime,
|
||||||
$session['path'],
|
path: '/',
|
||||||
$session['domain'],
|
domain: ''
|
||||||
$session['secure'],
|
|
||||||
$session['httponly']
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/** Backwards compatibility */
|
/** Backwards compatibility */
|
||||||
|
|
Loading…
Reference in a new issue