Re: Prevent guest session from expiring
I did not do any session binding. Do you mean binding HttpSession to Wicket session? What negative side effects will it have? Any docs on this? Thanks On Thu, Sep 30, 2010 at 3:30 AM, Martijn Dashorst < martijn.dasho...@gmail.com> wrote: > did you bind the session? > > On Wed, Sep 29, 2010 at 6:52 PM, Alec Swan wrote: > > Hello, > > > > I decided to set MaxInactiveInterval to 0 in onAfterRender in order to > > prevent guest sessions from expiring. So, my code looks like this: > > > > @Override > >protected void onAfterRender() { > >super.onAfterRender(); > > ((ServletWebRequest) > > > this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0); > > } > > > > However, this does not work because for some reason a new > > getRequest().getHttpServletRequest().getSession().session object every > time > > onAfterRender() is called, e.g. if I refresh the page. > > > > Why am I getting StandardSession objects with different ids in > > onAfterRender()? > > > > Thanks > > > > On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov >wrote: > > > >> Wicket Session is stored in HttpSession. > >> See > >> > >> > http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29 > >> > >> On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan wrote: > >> > >> > Are there any methods I can override in Wicket WebSession to make it > >> never > >> > expire? > >> > > >> > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi < > >> > martin.maku...@koodaripalvelut.com> wrote: > >> > > >> > > You can set session timeout per-session: > >> > > > >> > >((ServletWebRequest) > >> > > > >> > > > >> > > >> > request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); > >> > > > >> > > ** > >> > > Martin > >> > > > >> > > 2010/9/15 Jeremy Thomerson : > >> > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan > >> > wrote: > >> > > > > >> > > >> Isn't there a way to instruct Wicket not to create a session if > the > >> > user > >> > > is > >> > > >> not logged in? > >> > > >> > >> > > > > >> > > > a session will always be created. it won't be bound (and > therefore > >> > > stored) > >> > > > if you have all stateless pages - which isn't an easy task > >> > > > > >> > > > -- > >> > > > Jeremy Thomerson > >> > > > http://www.wickettraining.com > >> > > > > >> > > > >> > > > - > >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> > > For additional commands, e-mail: users-h...@wicket.apache.org > >> > > > >> > > > >> > > >> > > > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.4 increases type safety for web applications > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Prevent guest session from expiring
did you bind the session? On Wed, Sep 29, 2010 at 6:52 PM, Alec Swan wrote: > Hello, > > I decided to set MaxInactiveInterval to 0 in onAfterRender in order to > prevent guest sessions from expiring. So, my code looks like this: > > @Override > protected void onAfterRender() { > super.onAfterRender(); > ((ServletWebRequest) > this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0); > } > > However, this does not work because for some reason a new > getRequest().getHttpServletRequest().getSession().session object every time > onAfterRender() is called, e.g. if I refresh the page. > > Why am I getting StandardSession objects with different ids in > onAfterRender()? > > Thanks > > On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov wrote: > >> Wicket Session is stored in HttpSession. >> See >> >> http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29 >> >> On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan wrote: >> >> > Are there any methods I can override in Wicket WebSession to make it >> never >> > expire? >> > >> > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi < >> > martin.maku...@koodaripalvelut.com> wrote: >> > >> > > You can set session timeout per-session: >> > > >> > > ((ServletWebRequest) >> > > >> > > >> > >> request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); >> > > >> > > ** >> > > Martin >> > > >> > > 2010/9/15 Jeremy Thomerson : >> > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan >> > wrote: >> > > > >> > > >> Isn't there a way to instruct Wicket not to create a session if the >> > user >> > > is >> > > >> not logged in? >> > > >> >> > > > >> > > > a session will always be created. it won't be bound (and therefore >> > > stored) >> > > > if you have all stateless pages - which isn't an easy task >> > > > >> > > > -- >> > > > Jeremy Thomerson >> > > > http://www.wickettraining.com >> > > > >> > > >> > > - >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > > For additional commands, e-mail: users-h...@wicket.apache.org >> > > >> > > >> > >> > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prevent guest session from expiring
Hello, I decided to set MaxInactiveInterval to 0 in onAfterRender in order to prevent guest sessions from expiring. So, my code looks like this: @Override protected void onAfterRender() { super.onAfterRender(); ((ServletWebRequest) this.getRequest()).getHttpServletRequest().getSession().setMaxInactiveInterval(0); } However, this does not work because for some reason a new getRequest().getHttpServletRequest().getSession().session object every time onAfterRender() is called, e.g. if I refresh the page. Why am I getting StandardSession objects with different ids in onAfterRender()? Thanks On Sat, Sep 18, 2010 at 9:39 AM, Martin Grigorov wrote: > Wicket Session is stored in HttpSession. > See > > http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29 > > On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan wrote: > > > Are there any methods I can override in Wicket WebSession to make it > never > > expire? > > > > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi < > > martin.maku...@koodaripalvelut.com> wrote: > > > > > You can set session timeout per-session: > > > > > >((ServletWebRequest) > > > > > > > > > request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); > > > > > > ** > > > Martin > > > > > > 2010/9/15 Jeremy Thomerson : > > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan > > wrote: > > > > > > > >> Isn't there a way to instruct Wicket not to create a session if the > > user > > > is > > > >> not logged in? > > > >> > > > > > > > > a session will always be created. it won't be bound (and therefore > > > stored) > > > > if you have all stateless pages - which isn't an easy task > > > > > > > > -- > > > > Jeremy Thomerson > > > > http://www.wickettraining.com > > > > > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > >
Re: Prevent guest session from expiring
Wicket Session is stored in HttpSession. See http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29 On Sat, Sep 18, 2010 at 5:30 PM, Alec Swan wrote: > Are there any methods I can override in Wicket WebSession to make it never > expire? > > On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > > > You can set session timeout per-session: > > > >((ServletWebRequest) > > > > > request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); > > > > ** > > Martin > > > > 2010/9/15 Jeremy Thomerson : > > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan > wrote: > > > > > >> Isn't there a way to instruct Wicket not to create a session if the > user > > is > > >> not logged in? > > >> > > > > > > a session will always be created. it won't be bound (and therefore > > stored) > > > if you have all stateless pages - which isn't an easy task > > > > > > -- > > > Jeremy Thomerson > > > http://www.wickettraining.com > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > >
Re: Prevent guest session from expiring
Are there any methods I can override in Wicket WebSession to make it never expire? On Tue, Sep 14, 2010 at 10:25 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > You can set session timeout per-session: > >((ServletWebRequest) > > request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); > > ** > Martin > > 2010/9/15 Jeremy Thomerson : > > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan wrote: > > > >> Isn't there a way to instruct Wicket not to create a session if the user > is > >> not logged in? > >> > > > > a session will always be created. it won't be bound (and therefore > stored) > > if you have all stateless pages - which isn't an easy task > > > > -- > > Jeremy Thomerson > > http://www.wickettraining.com > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Prevent guest session from expiring
You can set session timeout per-session: ((ServletWebRequest) request).getHttpServletRequest().getSession().setMaxInactiveInterval(seconds); ** Martin 2010/9/15 Jeremy Thomerson : > On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan wrote: > >> Isn't there a way to instruct Wicket not to create a session if the user is >> not logged in? >> > > a session will always be created. it won't be bound (and therefore stored) > if you have all stateless pages - which isn't an easy task > > -- > Jeremy Thomerson > http://www.wickettraining.com > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prevent guest session from expiring
On Tue, Sep 14, 2010 at 10:51 PM, Alec Swan wrote: > Isn't there a way to instruct Wicket not to create a session if the user is > not logged in? > a session will always be created. it won't be bound (and therefore stored) if you have all stateless pages - which isn't an easy task -- Jeremy Thomerson http://www.wickettraining.com
Re: Prevent guest session from expiring
Isn't there a way to instruct Wicket not to create a session if the user is not logged in? On Tue, Sep 14, 2010 at 5:21 PM, Igor Vaynberg wrote: > a noop ajax poller on your base page will prevent sessions of open > windows from expiring. > > -igor > > On Tue, Sep 14, 2010 at 3:32 PM, Alec Swan wrote: > > Hello, > > > > A lot of times the users visit my web site without logging in. Currently, > > their session expire after a certain timeout. How can I prevent guest > > session from expiring? > > > > Also, where do I specify the page where the logged-in users get > redirected > > when their sessions expire? > > > > Thanks > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Prevent guest session from expiring
Jeremy, getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) is what I was looking for. I don't think I can use session timeout in web.xml because I want sessions of logged-in users to expire and guest sessions - not to expire. Thoughts? On Tue, Sep 14, 2010 at 5:06 PM, Jeremy Thomerson wrote: > On Tue, Sep 14, 2010 at 5:32 PM, Alec Swan wrote: > > > Hello, > > > > A lot of times the users visit my web site without logging in. Currently, > > their session expire after a certain timeout. How can I prevent guest > > session from expiring? > > > > session timeout is configured by your container > > > > Also, where do I specify the page where the logged-in users get > redirected > > when their sessions expire? > > > > getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) will > change where they go if they click a link on a page that has been expired > > -- > Jeremy Thomerson > http://www.wickettraining.com >
Re: Prevent guest session from expiring
a noop ajax poller on your base page will prevent sessions of open windows from expiring. -igor On Tue, Sep 14, 2010 at 3:32 PM, Alec Swan wrote: > Hello, > > A lot of times the users visit my web site without logging in. Currently, > their session expire after a certain timeout. How can I prevent guest > session from expiring? > > Also, where do I specify the page where the logged-in users get redirected > when their sessions expire? > > Thanks > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prevent guest session from expiring
On Tue, Sep 14, 2010 at 5:32 PM, Alec Swan wrote: > Hello, > > A lot of times the users visit my web site without logging in. Currently, > their session expire after a certain timeout. How can I prevent guest > session from expiring? > session timeout is configured by your container > Also, where do I specify the page where the logged-in users get redirected > when their sessions expire? > getApplicationSettings().setPageExpiredErrorPage(pageExpiredErrorPage) will change where they go if they click a link on a page that has been expired -- Jeremy Thomerson http://www.wickettraining.com
Prevent guest session from expiring
Hello, A lot of times the users visit my web site without logging in. Currently, their session expire after a certain timeout. How can I prevent guest session from expiring? Also, where do I specify the page where the logged-in users get redirected when their sessions expire? Thanks