Last active
December 12, 2015 10:48
-
-
Save zenwerk/4761423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* read a cookie | |
* | |
* @access private | |
* @return void | |
*/ | |
protected function _get_cookie() | |
{ | |
// was the cookie posted? | |
$cookie = \Input::post($this->config['post_cookie_name'], false); | |
// if not found, fetch the regular cookie | |
if ($cookie === false) | |
{ | |
$cookie = \Cookie::get($this->config['cookie_name'], false); | |
} | |
// Auth::checkが動かなかったのでコメントアウト | |
// if ($cookie !== false) | |
// { | |
// // fetch the payload | |
// $this->config['encrypt_cookie'] and $cookie = \Crypt::decode($cookie); | |
// $cookie = $this->_unserialize($cookie); | |
// | |
// // validate the cookie format | |
// if ( ! is_array($cookie) or empty($cookie[0]) or ! is_string($cookie[0])) | |
// { | |
// $cookie = false; | |
// } | |
// } | |
// | |
// // and the result | |
// return $cookie; | |
// 以前oil create したものからコピー | |
if ($cookie !== false) | |
{ | |
// fetch the payload | |
$this->config['encrypt_cookie'] and $cookie = \Crypt::decode($cookie); | |
$cookie = $this->_unserialize($cookie); | |
// and return it | |
return $cookie; | |
} | |
// no payload | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment