Middleware
class Middleware implements HttpKernelInterface (View source)
Properties
protected HttpKernelInterface | $app | The wrapped kernel implementation. | |
protected SessionManager | $manager | The session manager. | |
protected Closure|null | $reject | The callback to determine to use session arrays. |
Methods
void | __construct(HttpKernelInterface $app, SessionManager $manager, Closure $reject = null) Create a new session middleware. | |
Response | handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true) Handle the given request and get the response. | |
void | checkRequestForArraySessions(Request $request) Check the request and reject callback for array sessions. | |
SessionInterface | startSession(Request $request) Start the session for the given request. | |
void | closeSession(SessionInterface $session) Close the session handling for the request. | |
string | getUrl(Request $request) Get the full URL for the request. | |
void | collectGarbage(SessionInterface $session) Remove the garbage from the session if necessary. | |
bool | configHitsLottery(array $config) Determine if the configuration odds hit the lottery. | |
void | addCookieToResponse(Response $response, SessionInterface $session) Add the session cookie to the application response. | |
getLifetimeSeconds() Get the session lifetime in seconds. | ||
int | getCookieLifetime() Get the cookie lifetime in seconds. | |
bool | sessionConfigured() Determine if a session driver has been configured. | |
bool | sessionIsPersistent(array $config = null) Determine if the configured session driver is persistent. | |
SessionInterface | getSession(Request $request) Get the session implementation from the manager. |
Details
void __construct(HttpKernelInterface $app, SessionManager $manager, Closure $reject = null)
Create a new session middleware.
Response handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
Handle the given request and get the response.
void checkRequestForArraySessions(Request $request)
Check the request and reject callback for array sessions.
protected SessionInterface startSession(Request $request)
Start the session for the given request.
protected void closeSession(SessionInterface $session)
Close the session handling for the request.
protected string getUrl(Request $request)
Get the full URL for the request.
protected void collectGarbage(SessionInterface $session)
Remove the garbage from the session if necessary.
protected bool configHitsLottery(array $config)
Determine if the configuration odds hit the lottery.
protected void addCookieToResponse(Response $response, SessionInterface $session)
Add the session cookie to the application response.
protected getLifetimeSeconds()
Get the session lifetime in seconds.
protected int getCookieLifetime()
Get the cookie lifetime in seconds.
protected bool sessionConfigured()
Determine if a session driver has been configured.
protected bool sessionIsPersistent(array $config = null)
Determine if the configured session driver is persistent.
SessionInterface getSession(Request $request)
Get the session implementation from the manager.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Session/Middleware.html