Thread: [Cppcms-users] Detect expired session
Brought to you by:
artyom-beilis
From: Christian G. <chr...@gm...> - 2012-07-06 14:59:35
|
Hi all, is there a way to detect if a valid session gets expired? I would like to inform logged in users that their session has expired and that there may be some data lose (changed values without saving them). thanks -- Christian Gmeiner, MSc |
From: Artyom B. <art...@ya...> - 2012-07-06 15:38:52
|
>________________________________ > From: Christian Gmeiner <chr...@gm...> >To: cpp...@li... >Sent: Friday, July 6, 2012 5:59 PM >Subject: [Cppcms-users] Detect expired session > >Hi all, > >is there a way to detect if a valid session gets expired? If the session is expired you will get an empty session - i.e. the session would not be loaded. > I would like to inform logged in users that their session has > expired What do you mean? If the user had lost the session due to timeout it would have to login again. There are also several models of session expiration: http://cppcms.com/wikipp/en/page/cppcms_1x_config#session > and that there may be some data lose > (changed values withoutsaving them). See, NEVER store valuable information information in the session. This is not what the session is for. Session may expire, be deleted, the user may loose the cookie. So sessions is not good for this purpose. > >thanks >-- >Christian Gmeiner, MSc > Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: Christian G. <chr...@gm...> - 2012-07-07 09:16:20
|
> > > >is there a way to detect if a valid session gets expired? > > If the session is expired you will get an empty session - i.e. > the session would not be loaded. > okay... but what is the difference between a user that was never logged in and a user which session expired? > > > > I would like to inform logged in users that their session has > > expired > > What do you mean? > > If the user had lost the session due to timeout it would have to login > again. > > > There are also several models of session expiration: > > http://cppcms.com/wikipp/en/page/cppcms_1x_config#session > > Sessions are working fine that's not my problem! > > > and that there may be some data lose > > (changed values withoutsaving them). > > See, NEVER store valuable information information > > in the session. This is not what the session is for. > > Session may expire, be deleted, the user may loose the > cookie. So sessions is not good for this purpose. > I may be more clear here. the app i am developing is used to configure an embedded linux device (network settings etc). now i have a feature request to get informed if a user has changed some values in a html form (can be detected via ajax etc) went to drink a coffee for 13 minutes, but the session is only valid for 10 minutes. now the user comes back an filled out the form and presses apply. now he sees the login form again and wonders what happened to his changes. now it would be good to see a message in the login form that not all changes could be applied,due session timeout. thanks |
From: Lee E. <lee...@gm...> - 2012-07-08 06:50:15
|
you redirected him to the login page when you saw that his session is empty - before the redirect - see if he was trying to submit a form - and then add that message to his login screen On Sat, Jul 7, 2012 at 12:16 PM, Christian Gmeiner < chr...@gm...> wrote: > > > > > > >is there a way to detect if a valid session gets expired? > > > > If the session is expired you will get an empty session - i.e. > > the session would not be loaded. > > > okay... but what is the difference between a user that was never logged in > and a user which session expired? > > > > > > > I would like to inform logged in users that their session has > > > expired > > > > What do you mean? > > > > If the user had lost the session due to timeout it would have to login > > again. > > > > > > There are also several models of session expiration: > > > > http://cppcms.com/wikipp/en/page/cppcms_1x_config#session > > > > > > Sessions are working fine that's not my problem! > > > > > > and that there may be some data lose > > > (changed values withoutsaving them). > > > > See, NEVER store valuable information information > > > > in the session. This is not what the session is for. > > > > Session may expire, be deleted, the user may loose the > > cookie. So sessions is not good for this purpose. > > > > I may be more clear here. the app i am developing is used to configure an > embedded linux device (network settings etc). now i have a feature request > to get informed if a user has changed some values in a html form (can be > detected via ajax etc) went to drink a coffee for 13 minutes, but the > session is only valid for 10 minutes. now the user comes back an filled out > the form and presses apply. now he sees the login form again and wonders > what happened to his changes. now it would be good to see a message in the > login form that not all changes could be applied,due session timeout. > > thanks > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- -- lee Lee Elenbaas lee...@gm... |
From: <ele...@ex...> - 2012-07-08 12:47:39
|
or make a periodic ajax to check the state of the session. if it's expired then you can print it on screen. > you redirected him to the login page when you saw that his session is > empty > - before the redirect - see if he was trying to submit a form - and then > add that message to his login screen > > On Sat, Jul 7, 2012 at 12:16 PM, Christian Gmeiner < > chr...@gm...> wrote: > >> >> > > >> > >is there a way to detect if a valid session gets expired? >> > >> > If the session is expired you will get an empty session - i.e. >> > the session would not be loaded. >> > >> okay... but what is the difference between a user that was never logged >> in >> and a user which session expired? >> > >> > >> > > I would like to inform logged in users that their session has >> > > expired >> > >> > What do you mean? >> > >> > If the user had lost the session due to timeout it would have to login >> > again. >> > >> > >> > There are also several models of session expiration: >> > >> > http://cppcms.com/wikipp/en/page/cppcms_1x_config#session >> > >> > >> >> Sessions are working fine that's not my problem! >> >> > >> > > and that there may be some data lose >> > > (changed values withoutsaving them). >> > >> > See, NEVER store valuable information information >> > >> > in the session. This is not what the session is for. >> > >> > Session may expire, be deleted, the user may loose the >> > cookie. So sessions is not good for this purpose. >> > >> >> I may be more clear here. the app i am developing is used to configure >> an >> embedded linux device (network settings etc). now i have a feature >> request >> to get informed if a user has changed some values in a html form (can be >> detected via ajax etc) went to drink a coffee for 13 minutes, but the >> session is only valid for 10 minutes. now the user comes back an filled >> out >> the form and presses apply. now he sees the login form again and wonders >> what happened to his changes. now it would be good to see a message in >> the >> login form that not all changes could be applied,due session timeout. >> >> thanks >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. >> Discussions >> will include endpoint security, mobile security and the latest in >> malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > -- > -- > lee > Lee Elenbaas > lee...@gm... > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |