简体   繁体   中英

Slim Framework Sessions

Is there a middleware for sessions in PHP Slim Framework? If not, is there a lightweight session library that works well with the Slim Framework? Its important that the library supports session storage in a database (MySQL).

Slim session manager package can be used. It's available at:

https://github.com/yusukezzz/slim-session-manager

  1. Composer based installation
  2. Slim middleware
  3. Can be used with any database driver

Hope it helps.

PHP native sessions can be database backed.

PHP sessions in Database

It's pretty easy to use native PHP sessions, not sure why you'd need a library.

According to their Session Docs , they only have

  • Native Session Store
  • Cookie Session Store

It doesn't appear to have a database backed session. Maybe its in development or maybe there is a 3rd party plugin for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM