The use case is like this. You have logged-in in a browser's tab and in another tab, you click on a moderate-comment mail that automatically logs you in as another user, and takes you to the comments-moderation page of the application.
Now, at this point, I want to ask the user if he wants to switch account. [The way Google does if you are signing-in in two tabs as different users] So, instead of comment-moderation page, I want to take user to "Do want to switch account?" page (if another user is already logged-in in another tab). Depending on the users decision I will either invalidate the old session and log-in as new user or will just take the user to already logged in session's home page. The thing is, I wanted to do this all the time. Whenever I am calling MySession.get().setUser(UserVO uvo), I want to check if there already exists a different userVO in the same session. If so, the end user must be notified. Thanks Nishant On Sat, Mar 13, 2010 at 7:24 PM, Edward Zarecor <[email protected]>wrote: > What's the use case? Session events won't always occur within the > context of a RequestCycle, say, expiry. > > Even If the use case is related to a request something like this might > be cleaner: > > YourPage > > if (getYourApp().getYourSession().isWhatever()) > { > RequestCycle.get().setRedirect(true); > RequestCycle.get().setResponsePage(SomePage.class); > } else { .... > > Ed. > > On Sat, Mar 13, 2010 at 7:06 AM, Nishant Neeraj > <[email protected]> wrote: > > Hi, > > > > In my custom session, I have a method which, on certain condition, wants > to > > redirect the request to some page, other than the original. > > This is what I am doing, in the method: > > > > RequestCycle.get().setRedirect(true); > > RequestCycle.get().setResponsePage(SomePage.class); > > > > But the response continues to land on the originally requested page > > requested page. > > > > Is there any way to do this without invalidating the session? > > > > Thanks > > Nishant > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
