Re: [Cppcms-users] Purpose of session
Brought to you by:
artyom-beilis
|
From: Lederhilger M. <M.L...@ds...> - 2014-04-16 12:20:24
|
Am 2014-04-16 14:01, schrieb Martin Lederhilger: > Hello, > > I have a few questions regarding the purpose of session. First of all I > understand it's main purpose, which is distinguishing connections from > different users (= sessions). But apart from that, is it only used to > store some global and not often changing information like user id, csrf > token and alike, which is useful for all applications in an application > hierarchy? I would need to store some state per application in the An example of such a state in the application would be to collect some parameters on three different wizard pages, and to only apply them (eg. persist them in a configuration file) when the users finishes filling out the last page. > hierarchy per session. I think it is not good to store that in the > session itself - need for serialization / deserialization, changes to > the session can be lost if requests from the same session are handled in > parallel (if a second request which is changing the session is handled > in the time between load and save of the session of the first request). > Is it better to store the application state elsewhere? Is it possible to > get notified, if CppCMS garbage collects sessions, so that the > additional application state can be cleaned up too? > > Thank you for your answers, > > Martin Lederhilger > |