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
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to restrict multiple logon to an application?

How to restrict multiple logon to an application?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
7 Posts 5 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.
  • S Offline
    S Offline
    surender939
    wrote on last edited by
    #1

    pls help me to restrict multiple logons to an application with single user account

    E D 2 Replies Last reply
    0
    • S surender939

      pls help me to restrict multiple logons to an application with single user account

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      What Login control are you using? The logical way would be to check if the user has logged in by say; storing their login value in a temp table or session and then check that on the event which logs a user in, if their login id already exists in a temp table then give message showing that they are already logged in.

      The answers posted by me are suggestions only and cannot be used in anyway against me.

      S 1 Reply Last reply
      0
      • E eyeseetee

        What Login control are you using? The logical way would be to check if the user has logged in by say; storing their login value in a temp table or session and then check that on the event which logs a user in, if their login id already exists in a temp table then give message showing that they are already logged in.

        The answers posted by me are suggestions only and cannot be used in anyway against me.

        S Offline
        S Offline
        surender939
        wrote on last edited by
        #3

        thanks .netman for quick reply. And i want to know , we can get session_end event if user logs out and we can updated the table details in this event. but how to identify if user logs in and quits by closing the browser.

        1 Reply Last reply
        0
        • S surender939

          pls help me to restrict multiple logons to an application with single user account

          D Offline
          D Offline
          Dilip H Patel
          wrote on last edited by
          #4

          there are several ways to doing this. some are as follows [1]==> you should have create array(table, array list) of all login users and stored in application object. when new user will login, then first what you have to do is check if the user id exist in application object. if yes then, restrict him. when user log out then delete entry from application object. [2]==> you should make a boolean field in user master table in your database. when use login then set it true. and when user log off set it to false. make sure every login time that in database this field for that user set to false. Regards, Dilip Patel Sr. Software Engineer (.Net).

          S 1 Reply Last reply
          0
          • D Dilip H Patel

            there are several ways to doing this. some are as follows [1]==> you should have create array(table, array list) of all login users and stored in application object. when new user will login, then first what you have to do is check if the user id exist in application object. if yes then, restrict him. when user log out then delete entry from application object. [2]==> you should make a boolean field in user master table in your database. when use login then set it true. and when user log off set it to false. make sure every login time that in database this field for that user set to false. Regards, Dilip Patel Sr. Software Engineer (.Net).

            S Offline
            S Offline
            surender939
            wrote on last edited by
            #5

            thanks dilip for ur reply. But how to identity things like 1) what if the user logs in and log out by closing browser close button. 2) What if the user logs in and leave behind. thanks inadvance........

            K C 2 Replies Last reply
            0
            • S surender939

              thanks dilip for ur reply. But how to identity things like 1) what if the user logs in and log out by closing browser close button. 2) What if the user logs in and leave behind. thanks inadvance........

              K Offline
              K Offline
              K V Sekhar
              wrote on last edited by
              #6

              Do u got any solution . Plz let me know if u got it. I am also looking for the same. cheers, sekhar

              1 Reply Last reply
              0
              • S surender939

                thanks dilip for ur reply. But how to identity things like 1) what if the user logs in and log out by closing browser close button. 2) What if the user logs in and leave behind. thanks inadvance........

                C Offline
                C Offline
                canoeman
                wrote on last edited by
                #7

                If user doesn't log out before closing the browser, I don't think you have a choice but to wait for the session to expire. Except for... I did write an application once where I needed to positively know that a user's browser window was still open. I added a heartbeat feature so that the server would know when the browser was closed. Consisted of an empty paged named heartbeat.aspx page that had a tag. This causes the page to get refreshed every 30 seconds. Then include the page in a 0x0 pixel frame on all your web app pages (using a master page). Now every page of your application will have a heartbeat. Just add code-behind to hearbeat.aspx to automatically log them out if you don't get a heartbeat for over 30 seconds (or whatever value you want). Obviously not something you want to do on a high-traffic website but sounds like your application is low traffic - i.e 1 user at a time ;)

                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