How to abandon previous session of the same user?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoop s
    New Member
    • Feb 2011
    • 16

    How to abandon previous session of the same user?

    Hi,

    I 'm working on a web application. suppose user 'A' login from machine 'X'. If the same user tries to login from another machine, he should automatically signout from mechine'X'. In short i want to avoid multiple login. Pls Help me!!!. Thanks in advance

    Anoop S.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Before we can help you, please let us know about what form of authentication you're using :)

    It shouldn't be too hard to check the database for a field that indicates something about the computer the currently logged in user is using... Just compare it to something set in a cookie to determine whether or not the log-in is still valid.

    -Frinny

    Comment

    • anoop s
      New Member
      • Feb 2011
      • 16

      #3
      Thanks for immediate response, I am using form authentication.

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        If you want to keep an IP log, just make a table with USER and IP columns that keeps track of the current IP of the user. For easier, generate a session variable with a GUID and write it in your database.

        Comment

        Working...