session-timeout

How to configure a session timeout for Grails application?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 17:41:12
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 use the app. However, if I don't use my app for a while, even though my browser window is still open, the session variable looses it's value. Does this happens because the session expires? I was under impression that a session lives until the browser window is still open, but apparently I was wrong. What should I do to ensure all session variables I

How to empty/destroy a session in rails?

我的梦境 提交于 2019-11-27 17:33:27
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.. To clear the whole thing use the reset_session method in a controller. reset_session Here's the documentation on this method: http://api.rubyonrails.org/classes/ActionController/Base.html#M000668 Resets the session by clearing out all the objects stored within and initializing a new session object. Good luck! Lavixu session in rails is a hash object. Hence any function available for clearing hash will work with sessions. session.clear or if specific

PHP - make session expire after X minutes

风格不统一 提交于 2019-11-27 16:45:12
问题 i am using the following technique... From the login.php the form posts to the page check.php where i do this <?php $uzer = $_POST['user_name']; $pass = $_POST['user_pass']; require ('DB_connection.php'); $result = mysql_query("SELECT * FROM accounts WHERE user_Name='$uzer' AND user_Pass='$pass'"); if( mysql_num_rows( $result ) > 0) { $array = mysql_fetch_assoc($result); session_start(); $_SESSION['user_id'] = $uzer; header("Location:loggedin.php"); } else { header("Location:login.php"); } ?>

How to call sessionDestroyed when a session times out

与世无争的帅哥 提交于 2019-11-27 16:22:17
I am new to JSP. I used the following code in a class that implements HttpSessionListener to get SESSION OUT when the session times out: public void sessionCreated(HttpSessionEvent arg0) { System.out.print("SESSION Created"); } public void sessionDestroyed(HttpSessionEvent arg0) { System.out.print("SESSION OUT"); } and I set in web.xml : <session-config> <session-timeout>1</session-timeout> </session-config> The servlet waits more than two minutes, then it calls sessionDestroyed . Is there is a way to force sessionDestroyed when time out ? Thanks in advance. What makes you think that

Session timeout warning modal using react

流过昼夜 提交于 2019-11-27 14:05:25
问题 I have a requirement to display timeout warning modal after 13 mins of inactivity and end session after 15 mins if user takes no action. I need to achieve this using reactjs. I checked react-timeout at https://www.npmjs.com/package/react-timeout#react-classic-verbose, but that didn't help. If anyone knows of a way to do this, please share with me. 回答1: You can create a higher order component like this and can pass child component through higher order component HOC: `// code export default

Absolute session expiration after N minutes even if user is using the system

僤鯓⒐⒋嵵緔 提交于 2019-11-27 12:37:19
问题 I’m working on a grails web application with spring security. I have a requirement for forcing a session expiration after a fixed set of time even if the session is active. I think I can add filter and check for each request's last login time: if (CURRENT_TIME - LAST_LOGIN > ABSOLUTE_SESSIO EXPIRATION) then FORCE LOGOUT But the problem is that the session is still active on the server until the user makes request. Is this possible to destroy session immediately after N minutes even if user is

Session should never expire by itself

白昼怎懂夜的黑 提交于 2019-11-27 10:57:42
问题 I'm using login function in my site with session. This session of mine gets expired after a few minutes irrespective of whether the user has logged out or not. Now what I want is that the session should only get expired when a user logs out. If a user doesn't log out his account and then comes back after 2-3 days, even then he should appear logged in. I have found some examples where they have increased the time for a session to expire but I want that it should only expire on the log out

Which one is better, InProc or SQL Server, for Session State mode in asp.net?

这一生的挚爱 提交于 2019-11-27 10:53:44
问题 I am developing an ASP.NET website. I want to know which one is better in session state mode: InProc or SQL Server? I need to hear about your experiences on this issue. Another question is about cookieless attribute. Is there any security hole in my site if I set it to true? In all the samples I saw in MSDN site, this attribute was set to false. And the last question is about Timeout attribute. Does this attribute effect my sessions lifetime when I set it to InProc mode? 回答1: Better in terms

Detecting user inactivity over a browser - purely through javascript [duplicate]

微笑、不失礼 提交于 2019-11-27 10:53:17
This question already has an answer here: How to know browser idle time? 5 answers 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 out. We need to do it without jquery or anything such. I may use ajax. java servlet in other end is preferable. AnhSirk Dasarp Here is pure JavaScript way to track the idle time and when it reach certain limit do some action, you can modify accordingly and use var IDLE

How To Detect MVC 3 Session Expiration via JavaScript

无人久伴 提交于 2019-11-27 08:44:43
问题 I have an MVC 3 site with a session timeout of 2 minutes. If the user doesn't interact with the page within 2 minutes, they should be automatically forwarded to the login screen as soon as 2 minutes hits (not when they interact after 2 minutes). Any time the user interacts with the page while the session is still active, the session timeout needs to be reset to 2 minutes from that time. Our current implementation is as follows (source code is below): 1. When user logs in, call setTimeout