Full view of active sessions

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Full view of active sessions

    Hello.

    Is there any facility in PHP's session management library which allows
    one to have a full view of the active sessions? In other words, is it
    possible to check the existance and value of a given session variable in
    any of the active sessions?

    My goal is to make sure a user's access information is not used more
    than once to log into the system. So, when a user submits the
    authentication data, I would like to see if that login has already been
    used, i.e., there is a session variable in some session storing the
    login name and which contains the same value.

    At present, I can't think of another way of doing it other than directly
    accessing the session files on /tmp (assuming session data is being
    stored in files). But I don't like that idea quite so much. A cleaner
    solution which I have also considered is to have a column in the users
    table which indicates his login state. Before I go for the latter
    approach, I would just like to learn from you whether what I asked is
    possible.

    Thanks in advance,

    --
    Ney André de Mello Zunino
    Ney andré de mello zunino Guest

  2. Similar Questions and Discussions

    1. Listing active sessions
      Yes the session will actually remain on the server as all the browser does is actually force a new session. Note. since writing the above I have...
    2. Listing active sessions
      This seems to keep track of all sessions, even after the user has closed the browser. I have a member section on a website where I want to list...
    3. Illustrator to PDF full view problem
      I am not even quite sure how to explain this extremely irritating problem that I have been working on for hours, so here goes. I have created a...
    4. full view
      > I created a web page using the regular choices. When I refer to http://www.davidbartosik.com/faq.htm preview IS the web page so what you...
    5. is it possible to iterate through all the active sessions of an ASP.net application
      Is it possible to iterate through all the active sessions of an ASP.net application? I have this fancy user object (with all kinds of properties)...
  3. #2

    Default Re: [PHP] Full view of active sessions

    Here is a possible solution, but I don't know if it will work for your
    purposes:

    When a user logs in to your site, as part of the session store a random
    string (say a logincheck). Also insert this value into the database on
    the same row as the username/password is stored. Then on every page load
    check and make sure that "logincheck" string is valid. If someone tries
    to login again, the new "logincheck" will be stored in the database, and
    thus will make the first session invalid.

    The only drawback to this approach is that it logs out the first user,
    and doesn't notify the second user they shouldn't be logging in twice.
    It still does the job of allowing only one login per user quite
    effectively though.

    Jeremy

    On Tue, 2003-09-23 at 17:38, Ney André de Mello Zunino wrote:
    > Hello.
    >
    > Is there any facility in PHP's session management library which allows
    > one to have a full view of the active sessions? In other words, is it
    > possible to check the existance and value of a given session variable in
    > any of the active sessions?
    >
    > My goal is to make sure a user's access information is not used more
    > than once to log into the system. So, when a user submits the
    > authentication data, I would like to see if that login has already been
    > used, i.e., there is a session variable in some session storing the
    > login name and which contains the same value.
    >
    > At present, I can't think of another way of doing it other than directly
    > accessing the session files on /tmp (assuming session data is being
    > stored in files). But I don't like that idea quite so much. A cleaner
    > solution which I have also considered is to have a column in the users
    > table which indicates his login state. Before I go for the latter
    > approach, I would just like to learn from you whether what I asked is
    > possible.
    >
    > Thanks in advance,
    >
    > --
    > Ney André de Mello Zunino
    Jeremy Johnstone Guest

  4. #3

    Default Re: [PHP] Full view of active sessions

    I've used this technique quiet effectively in the past. I played
    around with some timeouts to try to prevent the second user from logging
    in but because of the nature of HTTP it is very hard to tell when
    someone has logged out when they don't click the logout button and you
    wind up preventing them from logging in again which is not good.

    Jeremy Johnstone wrote:
    >Here is a possible solution, but I don't know if it will work for your
    >purposes:
    >
    >When a user logs in to your site, as part of the session store a random
    >string (say a logincheck). Also insert this value into the database on
    >the same row as the username/password is stored. Then on every page load
    >check and make sure that "logincheck" string is valid. If someone tries
    >to login again, the new "logincheck" will be stored in the database, and
    >thus will make the first session invalid.
    >
    >The only drawback to this approach is that it logs out the first user,
    >and doesn't notify the second user they shouldn't be logging in twice.
    >It still does the job of allowing only one login per user quite
    >effectively though.
    >
    >Jeremy
    >
    >On Tue, 2003-09-23 at 17:38, Ney André de Mello Zunino wrote:
    >
    >
    >>Hello.
    >>
    >>Is there any facility in PHP's session management library which allows
    >>one to have a full view of the active sessions? In other words, is it
    >>possible to check the existance and value of a given session variable in
    >>any of the active sessions?
    >>
    >>My goal is to make sure a user's access information is not used more
    >>than once to log into the system. So, when a user submits the
    >>authentication data, I would like to see if that login has already been
    >>used, i.e., there is a session variable in some session storing the
    >>login name and which contains the same value.
    >>
    >>At present, I can't think of another way of doing it other than directly
    >>accessing the session files on /tmp (assuming session data is being
    >>stored in files). But I don't like that idea quite so much. A cleaner
    >>solution which I have also considered is to have a column in the users
    >>table which indicates his login state. Before I go for the latter
    >>approach, I would just like to learn from you whether what I asked is
    >>possible.
    >>
    >>Thanks in advance,
    >>
    >>--
    >>Ney André de Mello Zunino
    >>
    >>
    >
    >
    >
    Jason Sheets Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139