You must Sign In to post a response.
  • Category: ASP.NET

    Avoid Mutiple Login for same user

    I have created one ASP.Net Application, in this application i need to avoid multiple login for same user

    i create one field in user table when he/she sign in i update status flag "Y" when he/she click log out i update that flag to "N"

    my doubt is when user close the browser how can i update that value as "N" in SQL user table..

    any Suggestion or idea let me know i will try
  • #581371
    Hi,

    I think u can handle it through the session,like if(session.closed).Because session will hold information about the user until the browser is closed.


    Regards,
    Rathinavelu.A

  • #581372
    Session Timeout event can be handled in Session_End event in Global.asax page.

    Browser Closed event can be handled in the OnUnload Event of the body tag in the aspx page.

    Put your functionality to update the database in the above two events, that would solve your problem.

  • #581373
    can any one explain with coding?
    Regards
    N.Ravindran
    Your Hard work never fails

  • #581374
    Hi,
    I think this not possible for avoid multiple log in user because if you some user close the browser then you have write code and update the status flag 'N' but when some user direct close the PC and crash the browser then how to handle this???

    Thanks & Regards
    Patel Vipul

  • #581375
    ok any other way to avoid multiple login vipul
    Regards
    N.Ravindran
    Your Hard work never fails

  • #581377
    To avoid this you can make use of Timer set a timer for some particular time interval and then check the session value, if user has closed its machine you can set the flag off for that user.


    By this approach you can avoid this issue.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #581378
    yes i got it friends use like Session_End event in Global.asax page...

    default i set timeout 1 min for testing purpose...and tested

    placed update query in Session_End event in Global.asax file

    if user login i change status "Y" if browser close that value change "N" after 1 min..

    thks 4 all friends

    Regards
    N.Ravindran
    Your Hard work never fails


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.