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 determine whether a session is running on worker process or not?

How to determine whether a session is running on worker process or not?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
6 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.
  • R Offline
    R Offline
    Raheem MA
    wrote on last edited by
    #1

    Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA

    C 3 2 Replies Last reply
    0
    • R Raheem MA

      Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You're going about it wrong. Store a list of logged in users on the application level and check it when a user tries to log in. Add a time stamp for the last access, so you can time out users who didn't explicityl log out.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      R 1 Reply Last reply
      0
      • R Raheem MA

        Hello, I have a web application hosted on local machine. Ex: http://localhost/xyz.aspx We have login page which prompts for user id and password. Once the user is validated, enters into another page. On all other pages, the user name gets displayed. Can we determine is there any session for the website is running or not? if we can find it, we want to stop multiple users from logging in from the same system. Please give me any ideas on this. Thank you, Raheem MA

        3 Offline
        3 Offline
        333soori
        wrote on last edited by
        #3

        Hi Raheem, You can try like this.... If you are validating user login against database then add one more field 'status' in ur table and update this field for successful login. In this way if another user tries to login then you can check status field , if it is not updated allow login otherwise inform that this login is already in use., And dont forget to update status field when user logs out. Note: you need to explicitly update status field in session_end event and in page unload events. Hope this helps you. Happy coding Regards Surender M

        C 1 Reply Last reply
        0
        • 3 333soori

          Hi Raheem, You can try like this.... If you are validating user login against database then add one more field 'status' in ur table and update this field for successful login. In this way if another user tries to login then you can check status field , if it is not updated allow login otherwise inform that this login is already in use., And dont forget to update status field when user logs out. Note: you need to explicitly update status field in session_end event and in page unload events. Hope this helps you. Happy coding Regards Surender M

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          333soori wrote:

          Note: you need to explicitly update status field in session_end event and in page unload events.

          EVen this cannot be trusted, he needs to add a timeout, and store the time of each page request, so he can tell that enough time has passed to regard the user as logged out

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          • C Christian Graus

            You're going about it wrong. Store a list of logged in users on the application level and check it when a user tries to log in. Add a time stamp for the last access, so you can time out users who didn't explicityl log out.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            R Offline
            R Offline
            Raheem MA
            wrote on last edited by
            #5

            Thank you all for quick response, The website is already in production. The user name gets displayed on all the pages once the login successful. Suppose user A logged in and USER A is getting displayed on the next page. In another browser window user B logged in and USER B is getting displayed on the next page. Now, if you go th browser A, and do refresh the page, then USER B will be displayed on the page. this is the issue currently we have. How to overcome this? Please give me ideas :) Thank you, Raheem MA

            C 1 Reply Last reply
            0
            • R Raheem MA

              Thank you all for quick response, The website is already in production. The user name gets displayed on all the pages once the login successful. Suppose user A logged in and USER A is getting displayed on the next page. In another browser window user B logged in and USER B is getting displayed on the next page. Now, if you go th browser A, and do refresh the page, then USER B will be displayed on the page. this is the issue currently we have. How to overcome this? Please give me ideas :) Thank you, Raheem MA

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              shah_tech wrote:

              How to overcome this? Please give me ideas

              You have been given two ideas. Obviously, if you've released the product, you are going to have to change it to overcome this bug.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              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