Skip to content

Instantly share code, notes, and snippets.

@joelpittet
Created October 23, 2012 04:11
Show Gist options
  • Select an option

  • Save joelpittet/3936591 to your computer and use it in GitHub Desktop.

Select an option

Save joelpittet/3936591 to your computer and use it in GitHub Desktop.
Cookie minus salt
--- Cookie.php
+++ (clipboard)
@@ -39,6 +39,11 @@
* @var boolean Only transmit cookies over HTTP, disabling Javascript access
*/
public static $httponly = FALSE;
+
+ /**
+ * @var boolean Only turned off if the cookies need to be salted
+ */
+ public static $needs_more_salt = FALSE;
/**
* Gets the value of a signed cookie. Cookies without signatures will not
@@ -147,7 +152,7 @@
public static function salt($name, $value)
{
// Require a valid salt
- if ( ! Cookie::$salt)
+ if ( Cookie::$needs_more_salt && ! Cookie::$salt)
{
throw new Kohana_Exception('A valid cookie salt is required. Please set Cookie::$salt.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment