C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Session Timeout Redirect


Posted Date: 05 Jul 2008      Total Responses: 3

Posted By: Kumar       Member Level: Gold     Points: 1



Hi all,
i have used session and i set the session timeout to 2 mins .when the current page im viewing is timeout it should be redirect to login page when i enter the login user name and password it should be redirect to the page last i visited .
please give me some suggestions


Thanx in advance,






Responses

Author: Siddesh Kapadi    05 Jul 2008Member Level: SilverRating:     Points: 3

You can use the authenticated settings in web.config file.
This can be done using the FormsAuthentication as well. Try some code using forms authentication can check for the method is IsAuthenticated. This will give you the expected output.



Author: sandeep    07 Jul 2008Member Level: GoldRating:     Points: 5

put this code on aspx page.......
<script type="text/javascript" language="JavaScript">
window.onload=WindowLoad;
function WindowLoad(event)
{
setTimeout("location = 'Default.aspx';", 120000);
}
</script>


put this code on .cs file.........
protected void Page_Load(object sender, EventArgs e)
{
Session.Clear();
Session.Abandon();
FormsAuthentication.SignOut();
}



Author: Jessie    07 Jul 2008Member Level: GoldRating:     Points: 6

Using Window.setTimeout method

body.Attributes.Add("onLoad", "window.setTimeout(""window.location.href='login.aspx'""," & (Session.Timeout * 60 * 1000) + 10000 & ");")

Using Meta Tag - Refresh

Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) & "; url="Login".aspx")

Both these methods will redirect the user to login page after session timeout + 10 seconds. This is how you can redirect the user to login page after session timeout without user interaction.




Post Reply
You must Sign In to post a response.
Next : insert after that display in gridview rasie error please(The IListSource does not contain
Previous : Transfering data from textbox to listbox.
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use