zendframework / zend-expressive-session-cache

PSR-6 session persistence adapter for zend-expressive-session.
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Allow creating persistent session cookies #3

Closed weierophinney closed 6 years ago

weierophinney commented 6 years ago

By default, cookies created to indicate a session cookie expire when the browser closes or after a period of inactivity.

Sometimes, however, it's useful to have persistent session cookies, so that the user does not need to log in repeatedly. PHP allows this via the session.cookie_lifetime INI setting.

This patch provides the ability to mark a session cookie as persistent. When marked, the cache_expire value is used to set the Max-Age directive of the cookie.

To configure it, use the zend-expressive-session-cache.persistent configuration setting, passing a boolean true value to enable it. By default, the value is false.