StartSession
class StartSession (View source)
Properties
protected SessionManager | $manager | The session manager. | |
protected bool | $sessionHandled | Indicates if the session was handled for the current request. |
Methods
void | __construct(SessionManager $manager) Create a new session middleware. | |
mixed | handle(Request $request, Closure $next) Handle an incoming request. | |
void | terminate(Request $request, Response $response) Perform any final actions for the request lifecycle. | |
SessionInterface | startSession(Request $request) Start the session for the given request. | |
SessionInterface | getSession(Request $request) Get the session implementation from the manager. | |
void | storeCurrentUrl(Request $request, SessionInterface $session) Store the current URL for the request if necessary. | |
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. | |
int | getSessionLifetimeInSeconds() Get the session lifetime in seconds. | |
int | getCookieExpirationDate() 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. | |
bool | usingCookieSessions() Determine if the session is using cookie sessions. |
Details
void __construct(SessionManager $manager)
Create a new session middleware.
void terminate(Request $request, Response $response)
Perform any final actions for the request lifecycle.
protected SessionInterface startSession(Request $request)
Start the session for the given request.
SessionInterface getSession(Request $request)
Get the session implementation from the manager.
protected void storeCurrentUrl(Request $request, SessionInterface $session)
Store the current URL for the request if necessary.
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 int getSessionLifetimeInSeconds()
Get the session lifetime in seconds.
protected int getCookieExpirationDate()
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.
protected bool usingCookieSessions()
Determine if the session is using cookie sessions.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Session/Middleware/StartSession.html