Commit 7e28433a by Taylor Otwell

Refactor session class.

parent c19ab70a
...@@ -194,17 +194,19 @@ class Session { ...@@ -194,17 +194,19 @@ class Session {
static::driver()->save(static::$session); static::driver()->save(static::$session);
$config = Config::get('session');
if ( ! headers_sent()) if ( ! headers_sent())
{ {
$minutes = (Config::get('session.expire_on_close')) ? 0 : Config::get('session.lifetime'); $minutes = ($config['expire_on_close']) ? 0 : $config['lifetime'];
Cookie::put('laravel_session', static::$session['id'], $minutes, Config::get('session.path'), Config::get('session.domain'), Config::get('session.https'), Config::get('session.http_only')); Cookie::put('laravel_session', static::$session['id'], $minutes, $config['path'], $config['domain'], $config['https'], $config['http_only']);
} }
// 2% chance of performing session garbage collection... // 2% chance of performing session garbage collection...
if (mt_rand(1, 100) <= 2) if (mt_rand(1, 100) <= 2)
{ {
static::driver()->sweep(time() - (Config::get('session.lifetime') * 60)); static::driver()->sweep(time() - ($config['lifetime'] * 60));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment