Commit 560a4cc1 authored by Eric Barnes's avatar Eric Barnes

Added comments and changed the $cookie var to use implode.

parent 3d2aa29d
......@@ -60,7 +60,8 @@ class Auth {
$id = $cookie[0];
}
if ( ! is_null(static::$user = call_user_func(Config::get('auth.user'), $id)))
// Attempt to find the user and set the login session.
if ( ! is_null($user = call_user_func(Config::get('auth.user'), $id)))
{
static::login($user);
return static::$user;
......@@ -137,7 +138,7 @@ class Auth {
public static function remember($user, $ttl = 10080)
{
static::$user = $user;
$cookie = Crypter::encrypt($user->id.'|'.\Request::ip().'|'.md5(\Request::server('HTTP_USER_AGENT')).'|'.time());
$cookie = Crypter::encrypt(implode('|', array($user->id, \Request::ip(), md5(\Request::server('HTTP_USER_AGENT')), time()));
\Cookie::put('remember', $cookie, $ttl);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment