Download the PHP package overtrue/laravel-stateless-session without Composer
On this page you can find all versions of the php package overtrue/laravel-stateless-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download overtrue/laravel-stateless-session
More information about overtrue/laravel-stateless-session
Files in overtrue/laravel-stateless-session
Package laravel-stateless-session
Short Description A lightweight middleware to make api routing session capable.
License MIT
Informations about the package laravel-stateless-session
Laravel stateless session
A lightweight middleware to make api routing session capable.
Installing
Usage
Add the middleware (\Overtrue\LaravelStatelessSession\Http\Middleware\SetSessionFromHeaders
) to api route group.
Response header
This middleware will set session id to response headers with name 'x-session', if you want to update the header name, you can add header
to config/session.php
:
config/session.php
Request header
The api request must set the last session id to headers. Using axios as an example, we need to listen to the api response, retrieve the session ID from response headers and store it in local storage, then retrieve it and add it to the request header:
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
Project supported by JetBrains
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
PHP 扩展包开发
想知道如何从零开始构建 PHP 扩展包?
请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》
License
MIT