Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
610 additions
and 275 deletions.
- +5 −5 src/Illuminate/Auth/Guard.php
- +12 −64 src/Illuminate/Cookie/CookieJar.php
- +1 −46 src/Illuminate/Cookie/CookieServiceProvider.php
- +58 −0 src/Illuminate/Cookie/Queue.php
- +4 −0 src/Illuminate/Foundation/Application.php
- +16 −5 src/Illuminate/Http/Request.php
- +19 −1 src/Illuminate/Session/CookieSessionHandler.php
- +155 −0 src/Illuminate/Session/Middleware.php
- +21 −0 src/Illuminate/Session/SessionInterface.php
- +4 −10 src/Illuminate/Session/SessionManager.php
- +0 −112 src/Illuminate/Session/SessionServiceProvider.php
- +314 −32 src/Illuminate/Session/Store.php
- +1 −0 src/Illuminate/Session/composer.json
@@ -0,0 +1,58 @@ | ||
<?php namespace Illuminate\Cookie; | ||
|
||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\HttpKernelInterface; | ||
|
||
class Queue implements HttpKernelInterface { | ||
|
||
/** | ||
* The wrapped kernel implementation. | ||
* | ||
* @var \Symfony\Component\HttpKernel\HttpKernelInterface | ||
*/ | ||
protected $app; | ||
|
||
/** | ||
* The cookie jar instance. | ||
* | ||
* @var \Illuminate\Cookie\CookieJar | ||
*/ | ||
protected $encrypter; | ||
|
||
/** | ||
* Create a new CookieQueue instance. | ||
* | ||
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $app | ||
* @param \Illuminate\Cookie\CookieJar $cookies | ||
* @return void | ||
*/ | ||
public function __construct(HttpKernelInterface $app, CookieJar $cookies) | ||
{ | ||
$this->app = $app; | ||
$this->cookies = $cookies; | ||
} | ||
|
||
/** | ||
* Handle the given request and get the response. | ||
* | ||
* @implements HttpKernelInterface::handle | ||
* | ||
* @param \Symfony\Component\HttpFoundation\Request $request | ||
* @param int $type | ||
* @param bool $catch | ||
* @return \Symfony\Component\HttpFoundation\Response | ||
*/ | ||
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) | ||
{ | ||
$response = $this->app->handle($request, $type, $catch); | ||
|
||
foreach ($this->cookies->getQueuedCookies() as $cookie) | ||
{ | ||
$response->headers->setCookie($cookie); | ||
} | ||
|
||
return $response; | ||
} | ||
|
||
} |
Oops, something went wrong.