Download the PHP package battis/user-session without Composer
On this page you can find all versions of the php package battis/user-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download battis/user-session
More information about battis/user-session
Files in battis/user-session
Package user-session
Short Description User session management for Slim Framework
License MIT
Informations about the package user-session
Battis\UserSession
User session management for Slim Framework
Installation
Use
See example for sample implementation. The highlights are:
Add UserSession\Dependencies
definitions
Use UserSession\Dependencies
to prepare container with dependency definitions (this should be done before any additional app-specific definitions wherein you might want to override any of the UserSession defaults):
Implement UserEntityInterface
& UserRepositoryInterface
Define implementations of UserEntityInterface
and UserRepositoryInterface
and
Define these implementations (or, at least, your UserRepositoryInterface
implementation) in the container:
Define /auth
endpoints
Use UserSession\Controller
to define authentication endpoints (/auth/login
and /auth/logout
):
Use Session
or RequireAuthentication
middleware
Add a user session that provides access to the currently logged-in user to an endpoint (or group) by adding the UserSession\Middleware\Session
middleware:
Restrict access to an endpoint (or group) to authenticated users by adding the UserSession\Middleware\RequireAuthentication
middleware:
All versions of user-session with dependencies
slim/http Version ^1.2
slim/php-view Version ^3.2
slim/psr7 Version ^1.5