Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Limit Session Per User

I want to limit one session per user. Some idea how to do it?
1 person has
this question
+1
Reply
  • 1
    Here's how I did it.

    - Override Function UserLogin and in your function 1- generate a GUID, 2- write a session variable with that same value (I uses context.session("SessionGUID") 3- write the same GUID to the database along with the logged in username.

    Then, on various pages, read the sessionGUID and compare to the database value for the logged in user.

    If two users log in with the same username, the second user will overwrite the database GUID of the first user. So when the first user goes to a page where the values are checked, the sessionGUID and the database GUID will not match.

    I then redirect the user to an error page that says it appears they are already logged in, please log out and log in again. There may be a smoother approach to this last part, open to suggestions.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • COT PREMIUN 8.7.13 TOUCH UI

    Thank for you help altVader. I did it very semilar. This is how i did it.

    1- A table in my DB to control de session id with username.

    2-i did a page for not authorized alert

    3- Every login I change de session id of the user. Override UserLogin of ApplicationServices class.



    4- Check if user has different session Id on load page event, So it is different, redirect to not authorized page alert. Override PageBase

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated