Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Force logout.

Force logout.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gerrybrennan
    wrote on last edited by
    #1

    Hi I have a ASP.net application. I want to force a signout, if the user tries to access the same application in the following scenarios If Multiple tabs within a same browser or if multiple (same) browsers eg two applications of firefox. or if if multiple different (browsers) eg one firefox & one MS Explorer. Any help / advice apreciated in advance. G

    D A 2 Replies Last reply
    0
    • G gerrybrennan

      Hi I have a ASP.net application. I want to force a signout, if the user tries to access the same application in the following scenarios If Multiple tabs within a same browser or if multiple (same) browsers eg two applications of firefox. or if if multiple different (browsers) eg one firefox & one MS Explorer. Any help / advice apreciated in advance. G

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      You can check window.opener.location property. That should have a URL of the page which opened your page.

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      1 Reply Last reply
      0
      • G gerrybrennan

        Hi I have a ASP.net application. I want to force a signout, if the user tries to access the same application in the following scenarios If Multiple tabs within a same browser or if multiple (same) browsers eg two applications of firefox. or if if multiple different (browsers) eg one firefox & one MS Explorer. Any help / advice apreciated in advance. G

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Whenever some user logs in to a system, it actually creates a new session. Just store the Session id againist IP address in the database whenever the user logs in. Now create one handler from which check every request. Use IRequiresSessionState to get the session id. If the session is found in the database for the same IP, Server.Transfer to Logout page with a particular error. This way no more than 1 login would be allowed from the same IP. Remember : You should delete the entries as soon as the user logs out. Also you need to place a trigger which would automatically delete one record when Session expires in the server for the IP, so that if one user forgets to logout, he could login again after a certain Timeout range. Cheers. :rose:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        D 1 Reply Last reply
        0
        • A Abhishek Sur

          Whenever some user logs in to a system, it actually creates a new session. Just store the Session id againist IP address in the database whenever the user logs in. Now create one handler from which check every request. Use IRequiresSessionState to get the session id. If the session is found in the database for the same IP, Server.Transfer to Logout page with a particular error. This way no more than 1 login would be allowed from the same IP. Remember : You should delete the entries as soon as the user logs out. Also you need to place a trigger which would automatically delete one record when Session expires in the server for the IP, so that if one user forgets to logout, he could login again after a certain Timeout range. Cheers. :rose:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          This is a different thing. I assume he meant you should not be able to do Right click -> Open in new tab on any of the link. If he does, then he should be signed out.

          It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

          A 1 Reply Last reply
          0
          • D dan sh

            This is a different thing. I assume he meant you should not be able to do Right click -> Open in new tab on any of the link. If he does, then he should be signed out.

            It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

            A Offline
            A Offline
            Abhishek Sur
            wrote on last edited by
            #5

            That cant be done. Bcos in case of Firefox Session will be the same if you open a new tab. That is why if you login on an account using firefox, it will automatically transfered(which is of course not the case with IE) Might be he can disable right click .... :laugh:

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->** Simplify Code Using NDepend
            Basics of Bing Search API using .NET
            Microsoft Bing MAP using Javascript

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups