Commit 825e8b2d authored by Taylor Otwell's avatar Taylor Otwell

cleaning up code and comments.

parent a77196db
<?php namespace Laravel\Session\Drivers;
use Laravel\Crypter;
<?php namespace Laravel\Session\Drivers; use Laravel\Crypter, Laravel\Cookie as C;
class Cookie extends Driver {
......@@ -21,9 +19,9 @@ class Cookie extends Driver {
*/
public function load($id)
{
if (\Laravel\Cookie::has(Cookie::payload))
if (C::has(Cookie::payload))
{
return unserialize(Crypter::decrypt(\Laravel\Cookie::get(Cookie::payload)));
return unserialize(Crypter::decrypt(C::get(Cookie::payload)));
}
}
......@@ -41,7 +39,7 @@ class Cookie extends Driver {
$payload = Crypter::encrypt(serialize($session));
\Laravel\Cookie::put(Cookie::payload, $payload, $lifetime, $path, $domain);
C::put(Cookie::payload, $payload, $lifetime, $path, $domain);
}
/**
......@@ -52,7 +50,7 @@ class Cookie extends Driver {
*/
public function delete($id)
{
\Laravel\Cookie::forget(Cookie::payload);
C::forget(Cookie::payload);
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ abstract class Driver {
abstract public function delete($id);
/**
* Insert a fresh session and return the payload array.
* Create a fresh session array with a unique ID.
*
* @return array
*/
......
......@@ -298,10 +298,9 @@ class Payload {
// session on the user's subsequent requests to the application.
$this->cookie($config);
// Some session drivers implement the Sweeper interface, meaning that
// Some session drivers implement the Sweeper interface meaning that
// they must clean up expired sessions manually. If the driver is a
// sweeper, we need to determine if garbage collection should be
// run for the request.
// sweeper, we'll calculate if we need to run garbage collection.
$sweepage = $config['sweepage'];
if ($this->driver instanceof Sweeper and (mt_rand(1, $sweepage[1]) <= $sweepage[0]))
......
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