session-timeout

How to exec a function when codeigniter session expires

孤人 提交于 2019-12-11 19:24:59
问题 I got an users table on my database with a "Online" field, it gets the value "1" when the user loggin, and changes to 0 when the user logout. The problem is that if the user close the tab and don't click on the "Logout" button he stays Online forever. So I would like to hook some kind of function so when the session expires it changes the value of this "Online" field - on the database - to "0". I'm open to suggestions of course, because I don't what is the right approach for this. 回答1: Change

Redirecting to another page not working in javascript

删除回忆录丶 提交于 2019-12-11 18:05:44
问题 Hi folks. In my MVC application, I am trying to redirect to a login page, however it is not redirecting and I am getting a "server error". Here is the javascript: <script type="text/javascript"> function keepAlive() { window.clearTimeout(window.sessionKeepAlive); window.sessionKeepAlive = window.setTimeout(function() { if(confirm('refresh session?')) { // submit coding required } else { //window.location="/Employee/~/Account/LogOn" //location.replace("/Employee/~/Account/LogOn"); window

Timing out from a bean

纵饮孤独 提交于 2019-12-11 12:55:47
问题 I want my session to timeout after a given interval of time. In web.xml I've been using code like: <session-config> <session-timeout>20</session-timeout> </session-config> where 20 is the timeout period in minutes, which works correctly. What I would like to do is to do it programatically using code like this inside one of my beans as follow: @ManagedBean(name="login") @SessionScoped public class MyLoginBean implements HttpSessionListener, Serializable { // private variables etc.

Spring Why session get expired before session-timeout?

喜你入骨 提交于 2019-12-11 12:38:50
问题 I am using Spring security authentication and after successful logis is session set. I have configured session-timeout on 10 minutes, but session is removed after few minutes. I don't know why. Here is debug output: 2013-09-13 12:34:29 DEBUG HttpSessionEventPublisher:83 - Publishing event: org.springframework.security.web.session.HttpSessionDestroyedEvent[source=org.apache.catalina.session.StandardSessionFacade@5d67c24a] 2013-09-13 12:34:29 DEBUG SessionRegistryImpl:156 - Removing session

how to insert data in database before session timeouts within given time limit using java?

こ雲淡風輕ζ 提交于 2019-12-11 12:23:35
问题 If I am mentioning the session timeout in descriptor page <session-config> <session-timeout>30</session-timeout> </session-config> Before terminating session I want to do insert operation in database. Is there any possibility for insertion. I have a thought that when user logins the page and I can use trigger to insert the data for 30 minutes. But if anyone else changes to -1 or more than 30 mins without noticing the trigger is running when user logins at that case what can I do for it? 回答1:

Callback function for expired session for connect-redis in node.js

点点圈 提交于 2019-12-11 11:50:32
问题 I am using Connect on node.js with connect-redis as session store. Is there a way to attach a callback function to the the event when the session expires, so I can backup data from the session, before it gets deleted? 回答1: Its impossible because the expiration is done at redis side. The connect-redis session store uses setex . https://github.com/visionmedia/connect-redis/blob/master/lib/connect-redis.js#L80 You can set a insane maxAge and do expiration by yourself using setInterval OR Fork

ASP.net session issue with localhost

流过昼夜 提交于 2019-12-11 08:19:04
问题 I have an issue with sessions. My web site is implementing a logged users console, wich register a new user each time it logs in. If I try to open 2 pages within the same web explorer, it fails because the method first ask if the user is already connected for not registering it twice. This method take as parameter the sessionID, wich is provided by .net My question is : In the same browser (or in the same computer, localhost), the sessionID it's always the same or it generates when ? Thanks

Session expires after file download

非 Y 不嫁゛ 提交于 2019-12-11 07:58:20
问题 When a user downloads a file from my ASP.NET application, the session expires a few seconds after they download the file. Before the session expires that can perform any task, but after about 5-10 seconds, the session is restarted and they get logged out. I've created a simple page to demonstrate this. To run this simple page, create a new asp.net c# project, then insert the code into a new page. EDIT: This appears to be a IE7 problem. Firefox and Chrome are unaffected. I believe the code

IIS Session timeout and Forms Authentication loop

本小妞迷上赌 提交于 2019-12-11 04:03:13
问题 I seem to have a problem with timeouts and forms authentication loops in my application. The application is MVC3 based and is AJAX heavy. I find that even when a user is continuously working on the application and not being idle, sometimes they get kicked out and then forms authentication goes into a redirect loop with a 302 error. The application is hosted with a provider who tells me they have increased the session timeouts to 60 mint. My web.config setting for the application is as follows

how to show session is about to timeout dialog before 1 min in jsp?

自作多情 提交于 2019-12-11 04:00:45
问题 I am trying to show session is about to timeout dialog in my shiro based application here is my code what i tried but its not working yet... <% Subject user = SecurityUtils.getSubject(); Session usersession = user.getSession(true); if(user.isAuthenticated()){ Date startTime = usersession.getStartTimestamp(); //login time Date lastAccessTime = usersession.getLastAccessTime(); //last active time Date currentTime = new Date(); // current time long diffInSec = (currentTime.getTime()-