TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kumar AU
1.1k
320
63.2k
On session Timeout My page is not getting refreshed - MVC 4
Jun 13 2017 9:32 PM
I have already set the session time in web.Config file, after the session time out I want my page automatically to get refreshed and redirect to Login page, but its not happening, kindly find my code as mentioned below :- Pleaes help me , I have been trying since almost 1 week, but no progress.
HttpContext ctx = HttpContext.Current;
if (ctx.Session != null)
{
// check if a new session id was generated
if (ctx.Session.IsNewSession)
{
HttpContext ctx1 = HttpContext.Current;
// check sessions here
if (ctx.Session["UserName"] == null || !filterContext.HttpContext.Request.IsAuthenticated)
{
if (filterContext.HttpContext.Request.IsAjaxRequest())
{
FormsAuthentication.SignOut();
filterContext.Result = new RedirectResult("~/Authentication/Logon");
base.OnActionExecuting(filterContext);
}
}
}
}
Reply
Answers (
1
)
Simple page number for iTextsharp in C#
File upload in mvc