Browse Source

Provide immediate access to set cookies.

Taylor Otwell 13 years ago
parent
commit
374f72f5e5
1 changed files with 9 additions and 2 deletions
  1. 9 2
      laravel/cookie.php

+ 9 - 2
laravel/cookie.php

@@ -88,7 +88,14 @@ class Cookie {
 	{
 		if (headers_sent()) return false;
 
-		if ($minutes < 0) unset($_COOKIE[$name]);
+		if ($minutes < 0)
+		{
+			unset($_COOKIE[$name]);
+		}
+		else
+		{
+			$_COOKIE[$name] = $value;
+		}
 
 		$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
 
@@ -128,4 +135,4 @@ class Cookie {
 		return static::put($name, null, -2000);
 	}
 
-}
+}