Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
How can I detect multiple windows or tabs for some web application?
If i open same web application in one tab, i want to restrict site from opening in another tab.Any one give code plz.

Thanks & Regards
Hari
Posted
Updated 29-Nov-16 0:18am
v3
Comments
AnkitGoel.com 11-Dec-12 7:33am    
may be u can detect it by checking IP Address of each session.
Hari Krishna Prasad Inakoti 11-Dec-12 7:35am    
how?
can u explain?
AnkitGoel.com 11-Dec-12 7:40am    
In your global.asax file, overload session_start method create a global app level list of sessions and ip addresses.
And before adding to this list, Loop through all sessions and check the IP address or current session is same as any previous session or not?
If already exists with same IP then deny otherwise add current to list and let user access the site.
Hari Krishna Prasad Inakoti 11-Dec-12 7:53am    
can u give the code?.I'm new one of .net

Hi All,
I got Solution


VB
Public Sub TheSessionId()
        Dim ss As HttpSessionState = HttpContext.Current.Session
        If Not HttpContext.Current.Session("id") Is Nothing Then
            HttpContext.Current.Response.Redirect("InvalidAccess.aspx")
        Else
            HttpContext.Current.Session("id") = ss.SessionID
        End If
    End Sub
 
Share this answer
 
 
Share this answer
 
just check previous session is active or not and if active redirect to login/error page
 
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