• 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

session time out in application after specific time

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
In my application there is a need to end the sessions after specific time since with the increment of the sessions the server(WebLogic 8.1)is getting affected.So i tried by placing certain entries in my web.xml file of that application but sessions are not ending after that specified time even there has been no action done for that long time.

The entry i have made is this
------------------
<session-config>
<session-timeout>10</session-timeout>
</session-config>
-------------------
I have checked the code where at no other place it has been done.
Please suggest whether it is overlapping somewhere else or what i need to do more..
I cannot afford to do that in code since I have to make changes at many places.

Thanks in advance
Nilesh
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<session-timeout>10</session-timeout>



did you wait 10 minutes ?

The only other place I know where you wan set this timeout is the HttpSession itself:



(in seconds)
 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Simon ,
Thanks for response.Yes I waited for 10 minute and still it is not working.Please suggest do I need to set something else in xml file.

Thanks a Lot
Nilesh
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "not working"? That's not a very helpful description.

What is happening versus what is it that you expect to happen? Be explicit.
 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,
By saying this I meant the session should expire and not allow to take the request forward after 10 min but in my case even after 10 minute It is allowing that user to use the application.

Thanks
Nilesh Sah
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Simon Alvarez:


(in seconds)



This works fine. Just after login/pwd varification set session time using above statement. To make it configurable you can read value from property file as well.

Regards,
Jass
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nilesh Sah,

Did you restart the server after changing the web.xml?
And where is the <session-config> element placed in the web.xml?


Also, are you checking if the session is null before processing the request?

Before processing the request, check if session is null, the session will be null if it has timed out(or invalidated). If session is null then do what you need to do if the session is invalid. I mean process the request only if the session is not NULL.


Regards,
Ganesh
SCJP 1.4
SCWCD 1.4
SCBCD 1.3
 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ganesh,
I did restart the server after making modification in web.xml file.Is there any specific place i need to place session-config in web.xml.I am still wondering why it is not affecting the application

Thanks
Nilesh Sah
 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ganesh,
I did restart the server after making modification in web.xml file.Is there any specific place i need to place session-config in web.xml.I am still wondering why it is not affecting the application

Thanks
Nilesh Sah
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Is there any specific place i need to place session-config in web.xml.



NO. It has to be under <web-app>
 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vishnu,
I have placed it under <web-app>.

Thanks
Nilesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic