• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session time out in application after specific time

 
Nilesh Sah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
 
Rodrigo Alvarez
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Jass Singh
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • 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
 
Ganesh Chinni
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Vishnu,
I have placed it under <web-app>.

Thanks
Nilesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic