use session.
for different browser tabs the session is same.
to show same user page on every tab if same url hit than. follow these steps.
1) create session when user first login.
2) store session info in tempDb
3) on every page check for session. if it is not null than redirect user to home page. else redirect to login page.
4)on every logout delete records from tempdb.
Why do you want to do this? (Please don't say: to prevent a user from being logged in multiple times - tells us *why* that's a bad thing.) You can (and maybe should) always put in an IP check to prevent multiple logins from different IPs.
Yes Tim, this is one problem:" to prevent a user from being logged in multiple times". but In my application if i login with account x and in another tab we login with account y.
then, there is a problem with data stored in session which causes a lot of trouble.
If the two tabs or windows are sharing the same session how can anyone be logged in twice? How are you "logging people in"? Something sounds very screwy!
Yes Bear, Exactly this is my problem, trying to solve this.
when i logged in with account x in one tab. and in another tab logged in with y account.
Session get override and when i click on any thing on x account it open Y account.
So i am trying to prevent multiple login to resolve the issue.