session-timeout

session variables timeout in asp.net app

爷,独闯天下 提交于 2019-11-28 23:55:27
In my web app I'm using some session variables, which are set when I login: e.g. Session("user_id") = reader("user_id") I use this through my app. When the session variable times out, this throws errors mainly when connecting to the database as session("user_id") is required for some queries. How can I set my session variables so that once they are timed out to go to the login page or how can at least increase the length of time the are available? Kev I'm guessing you're using Forms Authentication. The trick here is to ensure that your Forms Authentication expires before the session does. I

Automatically perform action in client side when the session expires

梦想与她 提交于 2019-11-28 20:51:14
I want to display in a <p:growl> that the session has expired. I found many methods to handle session expiration like Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request , but I couldn't push a faces message to <p:growl> . To the point, how can I automatically run some (JavaScript) code in client side when the HTTP session has automatically expired in server side? uı6ʎɹnɯ ꞁəıuɐp You can use PrimeFaces idle monitor for this. User is redirected to logout action after timeout to invalidate the session. 2 minutes before a countdown dialog is shown to warn user. After

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

杀马特。学长 韩版系。学妹 提交于 2019-11-28 19:02:05
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 using the system? I was researching tomcat session management and how spring security handles it, but

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

青春壹個敷衍的年華 提交于 2019-11-28 18:19:33
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? Better in terms of what? InProc session is much much faster, has less requirements (serialization), but unusable when you're

Session should never expire by itself

China☆狼群 提交于 2019-11-28 17:58:58
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 event by the user irrespective of the time he took to log out. How can I do that? In particular, is this

Setting session timeout period with Spring Security 3.0

独自空忆成欢 提交于 2019-11-28 17:00:45
问题 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 回答1: You can either set the session timeout (say 60 minutes) for all sessions in web.xml: <session-config> <session-timeout>60</session-timeout> </session-config> or on a per-session basis using session.setMaxInactiveInterval(60*60); the latter you might want to do in a

Session_End in Global.asax.cs not firing using forms authentication

大兔子大兔子 提交于 2019-11-28 14:18:20
I have an asp.net 4.0 application that is using forms authentication set to a timeout at 45 minutes. I would like to redirect the user to a timeout page when the session has expired. Can anyone tell me how to do this? I am running .net 4.0. web.config has: <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx" protection="All" timeout="45" requireSSL="false"> </forms> </authentication> Global.asax.cs file has: void Session_End(object sender, EventArgs e) { Response.Redirect("~/Timeout.aspx"); } It's not possible to do a redirect in the Session

Can we personalize Session Timeout for Roles in ASP.NET MVC 5

一世执手 提交于 2019-11-28 11:27:30
The idea is to set different values of Session Timeout for different User Roles in ASP.NET MVC 5 and ASP.NET Identity. Is it possible to do? Based on their role you could set the timeout, i.e. HttpContext.Current.Session.Timeout = 20; Going by your previous question you want to do this dynamically. You could store and update the times themselves in session and set for each role on OnActionExecuting of a base controller. if (User.IsInRole("Admin")) { filterContext.HttpContext.Session.Timeout = (int)filterContext.HttpContext.Session["AdminTimeoutThatYouSetSomewhereElseGlobally"]; } If you are

Handling session time out when ajax call to C# mvc controller not working

十年热恋 提交于 2019-11-28 09:24:53
When calling a function from ajax. Program flow does not recognized the expired session i.e not redirect to the login page. Instead of that, it saves the record. I am working in c# .net mvc. So how can i handle session while ajax call. Here i gave my codes. $.ajax({ type: "POST", url:'/Employee/SaveEmployee', data: { Location:$("#txtLocation").val(), dateApplied:$("#txtDateApplied").val(), Status:$("#ddStatus").val(), mailCheck:$("#ddMailCheck").val(), ... ... ... }, success: function (result) { }, error: function (msg) { } }); Here the controller [Authorize] public string SaveEmployee(string

HttpSessionListener not detecting session timeout

♀尐吖头ヾ 提交于 2019-11-28 09:11:59
问题 I have an implementation of javax.servlet.http.HttpSessionListener that is supposed to detect user session invalidation/timeout in a Struts project. The sessionDestroyed() never seems to be getting called, I can reproduce this by deleting my JSESSIONID and refreshing the page. I also find that leaving the browser open until the session times out has the same effect. The site is running in JBoss 4.2.3.GA with Java 1.5. I'm starting to suspect that HttpSessionListener does not do what I expect