Click here to Skip to main content
15,913,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I finished login page but I copied that address and paste another tab, it was coming the same page, for example,
localhost:1288/xxx/purch.aspx
(If I'm copy to the same link and paste another tab,it was comin[g] home screen. Can u you anyone help me?
Posted
Updated 3-Apr-12 3:02am
v4
Comments
Shahin Khorshidnia 3-Apr-12 9:01am    
Hello, please do not use street language like wana (want to), comin (cominq) and also "electronic messaging" like u (you)

1 solution

Use Session to solve the problem.
Example:
In your case for every user name has a unique ID. Put that ID in a Session like
C#
Session["UserId"] = userid.ToString();

When successfully logged in.
Check in the login page:
C#
if(Session["UserId"] != null)
{
   redirect to another page.
}


When u you logout use the below line to abandon(terminate) the Session.
C#
HttpContext.Current.Session.Clear();
HttpContext.Current.Session.Abandon();
 
Share this answer
 
v3

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