drogonframework / drogonframework/drogon
Persistent sessions
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Is your feature request related to a problem? Please describe.**
It would be very helpfull if there are persistent sessions in drogon, so for example you dont need to re-login everytime the app restarts. It also would help with load-balancing application so sessions can get syncronized across app instances via the help of a database for example.
**Describe the solution you'd like**
Ideally, there would be a system that let's a app react on each change of a session: create, update (insert & erase), destroy.
I think the best solution would be to implement #1853 in addition with being able to access the session object itself in `AdviceStartSessionCallback` and `AdviceDestroySessionCallback`, i.e. by adding a parameter to pass `SessionPtr`.
If #1853 is not implemented, all of `Session`'s mutation methods would to be changed to allow to notify any custom logic about a changed session, this change notification then maybe could be reacted to with a `drogon::app().registerSessionChangeAdvice()` that also gets the `SessionPtr` as a parameter.
**Describe alternatives you've considered**
Only alternative right now, would to be write an custom solution for this and thus ignoring drogon's session feature completly.
Contributor guide
Assessment
This issue has not been assessed yet.