-
1. Re: How to redirect the user to the last page he left when the session expires?
pmuir Mar 19, 2008 12:58 PM (in response to janylj)File a feature request in JIRA.
-
2. Re: How to redirect the user to the last page he left when the session expires?
mrauls.mrauls.akimeka.com Dec 31, 2008 1:28 AM (in response to janylj)In case anyone else has this issue, there is a good solution here:
http://www.seamframework.org/Documentation/RedirectingBackToCurrentPageWhenSessionTimesOut
-
3. Re: How to redirect the user to the last page he left when the session expires?
joblini Dec 31, 2008 1:45 AM (in response to janylj)The solution proposed in that article is incredibly complicated, as is Bauer's approach, referenced in the same article.
Currently, after a session has expired, the server simply
forgets
everything associated with that session. The reason for this is to prevent resource leakage on the server. For example, Joe Blow goes on vacation without logging out.On the other hand, it is not acceptable for a user who has taken a coffee break to have his context, including any changes, lost.
It would be nice to have Seam persist conversation and session state to disc, and then restore these states if required.
This would solve the problem of resource leakage, while also allowing sessions to be
resumed
What do you think?
-
4. Re: How to redirect the user to the last page he left when the session expires?
kukeltje.ronald.jbpm.org Dec 31, 2008 4:41 AM (in response to janylj)
Ingo Jobling wrote on Dec 31, 2008 01:45:
On the other hand, it is not acceptable for a user who has taken a coffee break to have his context, including any changes, lost.uhhmm.... then make it longer?
Ingo Jobling wrote on Dec 31, 2008 01:45:
It would be nice to have Seam persist conversation and session state to disc, and then restore these states if required.Isn't this to a large extend the process scope? (I know I over simplify, but for the sake of discussion I do it anyway)
Or do I miss something?
-
5. Re: How to redirect the user to the last page he left when the session expires?
joblini Dec 31, 2008 4:57 AM (in response to janylj)Hi,
I'm just saying that, currently, Seam does nothing to deal with Session timeouts, and I think that there are better ways to handle this than simply discarding all state.
The posted solutions to preserve form submission contents after a session timeout are ridiculously complicated.
As you suggest, a workaround is to increase session timeout. Of course, this reduces the number of concurrent sessions that can be supported.
-
6. Re: How to redirect the user to the last page he left when the session expires?
joblini Dec 31, 2008 5:15 AM (in response to janylj)For example, display a logon page for longer that session timeout. This leads to the absurd situation where the user enters his username and password, clicks submit, and the response is
Session expired, please log in
.Can we do better than this?
-
7. Re: How to redirect the user to the last page he left when the session expires?
kukeltje.ronald.jbpm.org Dec 31, 2008 12:37 PM (in response to janylj)Ingo Jobling wrote on Dec 31, 2008 04:57:
As you suggest, a workaround is to increase session timeout. Of course, this reduces the number of concurrent sessions that can be supported.
That is why we make sure the real data in the session is allowed to be volatile and if someone is e.g. filling out a complex form (I use xforms for that) data for that form is persisted with the task (jbpm) that is carried out when the session expires. The data belongs to the task, is not completed yet, so just saved.... There is no need then to store session information persistently or have the need for knowing where to retrieve it again... yuck.... If the user comes back, there is still this task for him with all data he entered up to then... feels like a clean solution and it works
Ingo Jobling wrote on Dec 31, 2008 05:15:
For example, display a logon page for longer that session timeout. This leads to the absurd situation where the user enters his username and password, clicks submit, and the response isSession expired, please log in
.
Can we do better than this?This could/should indeed be improved.... kind of ugly I agree
-
8. Re: How to redirect the user to the last page he left when the session expires?
joblini Jan 1, 2009 1:00 AM (in response to janylj)
Ronald van Kuijk wrote on Dec 31, 2008 12:37:Ingo Jobling wrote on Dec 31, 2008 04:57:
As you suggest, a workaround is to increase session timeout. Of course, this reduces the number of concurrent sessions that can be supported.
That is why we make sure the real data in the session is allowed to be volatile and if someone is e.g. filling out a complex form (I use xforms for that) data for that form is persisted with the task (jbpm) that is carried out when the session expires. The data belongs to the task, is not completed yet, so just saved.... There is no need then to store session information persistently or have the need for knowing where to retrieve it again... yuck.... If the user comes back, there is still this task for him with all data he entered up to then... feels like a clean solution and it worksI wish that Seam would do this
out of the box
. Thanks for sharing your approach, I know I will have to deal with this sooner or later!
-
9. Re: How to redirect the user to the last page he left when the session expires?
joblini Jan 1, 2009 1:02 AM (in response to janylj)Feature request opened in JIRA:
Recover gracefully from Session timeout -
10. Re: How to redirect the user to the last page he left when the session expires?
kukeltje.ronald.jbpm.org Jan 1, 2009 1:31 PM (in response to janylj)
Ingo Jobling wrote on Jan 01, 2009 01:00:
I wish that Seam would do thisout of the box
. Thanks for sharing your approach, I know I will have to deal with this sooner or later!
I personally think this is a design thing and not something seam can do out of the box on its own, since it has no knowledge of what you want to achieve. But it is really simple to achieve: use the @Destroy annotation.
Our complex forms are xforms based and jsf is used for the rest of the ui. The really nice thing about xforms is that it results in an xml object of your form, not a detailed database model. Much easier to create, persist etc... So we only have this object to persist and extract some data from it to be stored in the domainmodel. Since the form is filled out while using ajax underneath (dojo/dwr) it is always in sync. This xforms object is in a conversation-scoped component and when the conversation is destroyed, we just set a jbpm task variable with the serialized value of this object. Really simple. When the task is opened again, this value is read and used to pre-fill the form....
You see, there is not much to it.... just some out of the box thinking, or was it inside the box?
The other issue about the logging in remains though..