Questions tagged [session-timeout]

A session timeout occurs when a unique application session (e.g. a web session) expires due to a time limitation placed on the session.

A session is a way of uniquely identifying an instance of usage of an application. This is often achieved by the assignation of a unique token, which the user must provide each time they invoke an operation within the application. In this way, sessions are one way of overcoming the stateless nature of HTTP requests.

A session may have an arbitrary expiry time associated with it. Once this expiry time has been reached, the session is no longer considered valid. Session expiries can either be fixed or sliding; a fixed expiry indicates a definite point in time at which the session becomes invalid, while a sliding expiry indicates the maximum amount of time between individual requests which is allowed to elapse before the session becomes invalid. In this manner, a sliding expiration may never timeout.

Session timeouts are not errors in themselves; they are valid states of a session which indicate that the session should not be used, and all requests which attempt to use the expired session should be treated as erroneous. However, faults may arise due to sessions timing out before they have expired, or sessions considered valid when they have passed their expiration time.

See also: Session (computer science), Session Management, HTTP Cookies

1258 questions
162
votes
7 answers

How to change the session timeout in PHP?

I would like to extend the session timeout in php I know that it is possible to do so by modifying the php.ini file. But I don't have access to it. So is it possible to do it only with php code?
Oli
  • 15,347
  • 7
  • 47
  • 62
139
votes
5 answers

How to empty/destroy a session in rails?

I can't seem to find it anywhere... How do I delete/destroy/reset/empty/clear a user's session in Rails? Not just one value but the whole thing..
tybro0103
  • 43,805
  • 32
  • 138
  • 167
92
votes
1 answer

Default session timeout for Apache Tomcat applications

What is the default session timeout for web applications deployed on Tomcat5.5? Is it browser specific? In my web application, default timeout is mentioned neither in web.xml nor in code.
Infotechie
  • 1,553
  • 6
  • 21
  • 31
61
votes
2 answers

SessionTimeout: web.xml vs session.maxInactiveInterval()

I'm trying to timeout an HttpSession in Java. My container is WebLogic. Currently, we have our session timeout set in the web.xml file, like this 15 Now, I'm being told that…
Tom
  • 39,851
  • 25
  • 129
  • 164
60
votes
7 answers

How to configure a session timeout for Grails application?

In one of controllers in my Grails application I'm preserving a parameter value in a session variable like this: session.myVariable = params.myValue After that, I can access the saved value from different controllers/GSP-pages as long as I actively…
curd0
  • 1,982
  • 3
  • 22
  • 27
51
votes
2 answers

Setting session timeout period with Spring Security 3.0

I am using Spring Security 3.0 to authenticate with an LDAP server and I cannot figure out to set my own session timeout period. I believe that the default is 30 minutes but I need to set it to longer than that
Benoit Martin
  • 3,243
  • 2
  • 20
  • 22
48
votes
1 answer

How to handle session expiration and ViewExpiredException in JSF 2?

Consider the following scenario. I am clicking the submit button of a JSF form, after the session has timed out(expired). The browser displays some exception message: ViewExpiredException: view context could not be restored What I want to do is,…
Selvin
  • 11,543
  • 15
  • 57
  • 78
46
votes
6 answers

Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request

I find this article to be useful for non-ajax request How to handle session expiration and ViewExpiredException in JSF 2? but I can't make use of this when I am submitting using an AJAX call. Suppose in a primefaces dialog, I am making a post…
Mark Estrada
  • 8,275
  • 34
  • 107
  • 173
44
votes
3 answers

Angular session timeout and management

Is there any way to manage user session using Angularjs?, I mean:: Session timeout - when system is idle. Alerts when session is near to expire with option to resume session. Redirect (or any other action) when trying to make a request if session…
Osy
  • 1,493
  • 4
  • 19
  • 34
37
votes
3 answers

IIS Session Timeout vs ASP.NET Session Timeout

In IIS 6 (and other versions too afaik), there is a Session Timeout setting in Properties -> Home Directory Tab -> Configuration button -> Options tab. Looks like this: And in the ASP.NET web.config there is a SessionState setting, looks like…
codeulike
  • 20,946
  • 27
  • 113
  • 161
35
votes
4 answers

Session timeouts in PHP: best practices

What is the actual difference between session.gc_maxlifetime and session_cache_expire() ? Suppose I want the users session to be invalid after 15 minutes of non-activity (and not 15 after it was first opened). Which one of these will help me…
Chad
  • 1,822
  • 1
  • 20
  • 26
34
votes
3 answers

Logout/Session timeout catching with spring security

I'm using spring/spring-security 3.1 and want to take some action whenever the user logs out (or if the session is timed out). I managed to get the action done for logout but for session timeout, I can't get it working. In web.xml I only have the…
Perre
  • 641
  • 1
  • 7
  • 12
30
votes
9 answers

Set Session Expiration Time Manually-CodeIgniter

How can I set session expiration time dynamically in codeigniter? For example, if a user logs in and has the role of admin, the expiration time should be longer than if a user logs in who does not have an admin role. Thanks.
Siregar
  • 301
  • 1
  • 3
  • 3
30
votes
1 answer

Changing the default session timeout of a spring web application

I have to test a web application that is written by spring and jsp. The default session-timeout for the application is 30 min. I want to reduce the session-timeout. For doing this, I have changed in the web.xml file in…
HassanF
  • 465
  • 1
  • 6
  • 13
27
votes
2 answers

Detecting user inactivity over a browser - purely through javascript

In building a monitor, which would monitor any activity on the browser by the user, like click of a button or typing on a textbox (not mouse hovering on document). So if there is no activity from the user for a long time, the session will time…
Ranjan Sarma
  • 1,525
  • 5
  • 21
  • 34
1
2 3
83 84