Browse Source

Fix bug in cookie class.

Taylor Otwell 13 years ago
parent
commit
193396506e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      laravel/cookie.php

+ 4 - 4
laravel/cookie.php

@@ -88,6 +88,10 @@ class Cookie {
 	{
 		if (headers_sent()) return false;
 
+		$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
+
+		$value = static::hash($name, $value).'~'.$value;
+
 		if ($minutes < 0)
 		{
 			unset($_COOKIE[$name]);
@@ -97,10 +101,6 @@ class Cookie {
 			$_COOKIE[$name] = $value;
 		}
 
-		$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
-
-		$value = static::hash($name, $value).'~'.$value;
-
 		return setcookie($name, $value, $time, $path, $domain, $secure, $http_only);
 	}