hapijs / yar

A hapi session manager
Other
133 stars 59 forks source link

Allow specification of whether to store blank sessions #75

Closed connor4312 closed 9 years ago

connor4312 commented 9 years ago

We've been using Yar for sessions, and storing sessions in Redis. Over time, a very large number of entirely empty sessions have accumulated; these are created on requests with authentication is optional, which in our case is the majority of routes.

This PRs adds an option, storeBlank which simply sets the initial _isModified property, which causes new sessions that are not changed to not be persisted or sent down in the set-cookie. It defaults to true - which is the current behaviour of the library - so no breaking change is introduced.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.