Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
if the user closed the tab accidentally or intentionally before he/she logout and then if he/she opens the same link (ULR) he/she should get his/her page directly without the need to login again ? Like Facebook?
Posted
Updated 24-Dec-14 19:30pm
v2
Comments
Sergey Alexandrovich Kryukov 25-Dec-14 1:35am    
Why the need to login again, if the session is not closed? Aren't you inventing a non-existing problem?
—SA
iamvinod34 25-Dec-14 2:04am    
no...plz read again
plz help me

1 solution

Simple. In Login Page_load event check if session is there then redirect to the home page.

Your code snippet may look like

C#
protected void Page_Load(object sender, EventArgs e)
	{
        if (Session["UserId"]!=null)
        {
            Response.Redirect("Home.aspx");
        }
	}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900