StartSession
class StartSession (View source)
Properties
protected SessionManager | $manager | The session manager. |
Methods
void | __construct(SessionManager $manager) Create a new session middleware. | |
mixed | handle(Request $request, Closure $next) Handle an incoming request. | |
Session | startSession(Request $request) Start the session for the given request. | |
Session | getSession(Request $request) Get the session implementation from the manager. | |
void | collectGarbage(Session $session) Remove the garbage from the session if necessary. | |
bool | configHitsLottery(array $config) Determine if the configuration odds hit the lottery. | |
void | storeCurrentUrl(Request $request, Session $session) Store the current URL for the request if necessary. | |
void | addCookieToResponse(Response $response, Session $session) Add the session cookie to the application response. | |
void | saveSession(Request $request) Save the session data to storage. | |
int | getSessionLifetimeInSeconds() Get the session lifetime in seconds. | |
DateTimeInterface|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. |
Details
void __construct(SessionManager $manager)
Create a new session middleware.
protected void collectGarbage(Session $session)
Remove the garbage from the session if necessary.
protected bool configHitsLottery(array $config)
Determine if the configuration odds hit the lottery.
protected void storeCurrentUrl(Request $request, Session $session)
Store the current URL for the request if necessary.
protected void addCookieToResponse(Response $response, Session $session)
Add the session cookie to the application response.
protected void saveSession(Request $request)
Save the session data to storage.
protected int getSessionLifetimeInSeconds()
Get the session lifetime in seconds.
protected DateTimeInterface|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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.8/Illuminate/Session/Middleware/StartSession.html