function key_make() { $cookie = so_cookie::make('so_user_key'); $key = $cookie->value; if (!$key) { $key = so_crypt::generateKey(); $cookie->value = $key; } return $key; }
function get_key($key) { if (isset($key)) { return $key; } $cookie = so_cookie::make('so_user_key'); $key = $cookie->value; if (!$key) { $key = so_crypt::generateKey(); $cookie->value = $key; } return $key; }