Session
in package
implements
MiddlewareInterface
Returns HTTP 401 if no session is defined by other means like BasicAuth, or KeyHeaderAuth.
Returns HTTP 400 if user cannot be properly authorized by this middleware.
Tags
Interfaces, Classes and Traits
- MiddlewareInterface
Table of Contents
- SESSION_USER_LOGIN_ATTRIBUTE = 'api_session_user_login'
- __construct() : mixed
- process() : ResponseInterface
- setExternalSessionAllowed() : $this
- Switches behavior in regard to the session origin.
Constants
SESSION_USER_LOGIN_ATTRIBUTE
public
mixed
SESSION_USER_LOGIN_ATTRIBUTE
= 'api_session_user_login'
Methods
__construct()
public
__construct(ResponseFactoryInterface $factory) : mixed
Parameters
- $factory : ResponseFactoryInterface
Return values
mixed —process()
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface
Return values
ResponseInterface —setExternalSessionAllowed()
Switches behavior in regard to the session origin.
public
setExternalSessionAllowed(bool $isAllowed) : $this
Set to false
to require session to originate from the handled request.
Set to true
to accept sessions that were started within a different request (e.g. by navigating to Plesk and logging in there).
Parameters
- $isAllowed : bool