ParagonIE\Halite\Cookie::store PHP Method

store() public method

Store a value in an encrypted cookie
public store ( string $name, mixed $value, integer $expire, string $path = '/', string $domain = '', boolean $secure = true, boolean $httpOnly = true ) : boolean
$name string
$value mixed
$expire integer (defaults to 0)
$path string (defaults to '/')
$domain string (defaults to NULL)
$secure boolean (defaults to TRUE)
$httpOnly boolean (defaults to TRUE)
return boolean
    public function store(string $name, $value, int $expire = 0, string $path = '/', string $domain = '', bool $secure = true, bool $httpOnly = true) : bool
    {
        return \setcookie($name, Crypto::encrypt(new HiddenString(\json_encode($value)), $this->key), $expire, $path, $domain, $secure, $httpOnly);
    }