Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make application that if user in logged in the web site in one tab of browser and if he open application in second tab than he should not redirect to login page but he should redirect to Home page. just like Facebook or yahoomail in asp.net C#

please help
Posted
Comments
Tarika Joshi 10-Sep-11 6:03am    
i need to give a different session id to the unique user every time he opens the same website in different window

Set your home page is the default page in site URL and write code for checking authentication in page load, This will redirect your Home page to login page if the user not logged in



One way of doing this is

Step 1) Assign one session variable with login user on the log in time in login page

Step 2) check that above session variable on each pages page load (Check session variable is null or not)

Step 3) Assign null to session variable on log out
 
Share this answer
 
v2
Comments
pchindhade 10-Sep-11 5:44am    
I have done that but in authenticating it is showing error of object reference not set.

I have written code like if cookie is null than redirect to login.aspx and if not null than to home page. but on login.aspx page load it is showing this error.
thank you for reply
please help
Arun Kumar K S 10-Sep-11 5:50am    
Use session variable instead of cookies
Hi pchindhade,

If you use the session properly,you don't get such problems.
For details click below link
Click me
any more queries just place a comment.
Have a good time!!!
 
Share this answer
 

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