hello,
Hope everyone is doing fine
I want to redirect to logout page after session is null or expired.
I am able to do it with Global.asax file with following code :
I have created Session["LoginCheckSession"] while login or after signup.
public class SessionTimeoutAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
HttpContext ctx = HttpContext.Current;
if (HttpContext.Current.Session["LoginCheckSession"] == null)
{
filterContext.Result = new RedirectResult("~/Home/Index");
return;
}
base.OnActionExecuting(filterContext);
}
}
But I have TWO different sessions for two different Login pages, one for Admin and Other for User
With the above code, I can only redirect to either Admin or User Login page
So is there any way I can use two different sessions on global.asax file and then redirect to a different login page
Or anyway I can keep the session alive for a long time
thank you in advance
Guest UserPosted Nov 21, 2020, 9:17 AM
Sachin SinghPosted Nov 21, 2020, 9:07 AM
Guest UserPosted Nov 21, 2020, 8:40 AM
Sachin SinghPosted Nov 21, 2020, 8:29 AM
Guest UserPosted Nov 21, 2020, 8:19 AM
Sachin SinghPosted Nov 21, 2020, 8:14 AM
Guest UserPosted Nov 21, 2020, 7:52 AM
Sachin SinghPosted Nov 20, 2020, 2:20 PM
Guest UserPosted Nov 20, 2020, 1:26 PM
Sachin SinghPosted Nov 20, 2020, 12:16 PM
Guest UserPosted Nov 20, 2020, 11:48 AM
Sachin SinghPosted Nov 19, 2020, 12:58 PM