• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sessions?

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
when will a session gets invalidated.when i set the session to setMaxInactiveInterval(-1) the session should not timeout.but i am getting as "session invalidated."can some one throw some light on this.
Regards!
Preethi.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm in the API both setMaxInactiveInterval() and getMaxInactiveInterval() say it should not timeout.
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you test? I tested with -1 argument and didn't get any such errors. What I did was, after a user successfully logd into web appln I usually create a session with HttpSession sessn = request.getSession(true) . Now I added one more line as sessn.setMaxInactiveInterval(-1); statement and the web appln behaves as before.
But if you purposly make sessn.invalidate(), the session WILL get invalidated.
How did you test your case?
regds
maha anna
 
Preethi Suryam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maha Anna!
I am testing it with HttpSessionBindingListner valueunbound().I have set session.putValue() and then setMaxInactiveInterval(-1).
In the next jsp page i am getting the value and the value comes out to be null.I am using JRun and Beans.
Thanks and Regards!
Preethi
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Preethi,
Did you comment the 'setMaxInactiveIntervel(-1);' line and check? Just to fine out where the problem is.
Try to comment and uncomment 'setMaxInactiveIntervel(-1);' and 'BindingLinstener' and see if we could pinpoint the problem.
regds
maha anna
 
Preethi Suryam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mana Anna!
I tried out setMaxInactiveInterval(10*60*60) it is working fine.JRun is not accepting -1.
-1 is working fine with java web server.And while configuring JRun it is very well given that we can give -1 for a session not to time out.could u tell me the reason? Anyway my module is working fine now.Thanx a lot for ur concern and help.
Regards!
Preethi.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Do I need to do the setMaxinactiveInterval in all the pages or the SignIn page(the SignIn page is where the user sign in), all I want the session to remember is the signid and password.
But even I specified setMaIactiveInterval(3600000)in the SignIn page and I still getting time out.
please advise.
Thanks
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setMaxInactiveInterval(int interval)

Set a session timeout interval, in seconds, as an integer, overriding any default in the servlet container or set through the web.xml <session-timeout> element. A negative value indicates no timeout. A value of 0 results in an immediate timeout


If you want to time out otherwise use session.invalidate()

You can check with isNew() to identify the session or comparing id's by getId()
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic