From a11c456f423e069f4b0f9ae11c4f9e6a5cdad0b3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 7 Nov 2011 10:22:02 -0600 Subject: [PATCH] Fix keep method and added started method. --- laravel/session.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/laravel/session.php b/laravel/session.php index c83a38cd..a0e144eb 100644 --- a/laravel/session.php +++ b/laravel/session.php @@ -71,6 +71,16 @@ class Session { return is_null(static::$session) or ($idle > ($lifetime * 60)); } + /** + * Determine if session handling has been started for the request. + * + * @return bool + */ + public static function started() + { + return is_array(static::$session); + } + /** * Determine if the session or flash data contains an item. * @@ -156,7 +166,12 @@ class Session { */ public static function keep($keys) { - foreach ((array) $keys as $key) static::flash($key, static::get($key)); + foreach ((array) $keys as $key) + { + $key = str_replace(array(':old:', ':new:'), '', $key); + + static::flash($key, static::get($key)); + } } /**