How do I determine who is logged in? I need to retrieve an array of all the users info, which I could do but I can't figure out how to determine who is actually logged in.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I needed to find out who was logged in, I'd probably use the psa_sessions table to get that information. The value field has a serialized session array, therefore, you could find something like the following in there:
PSA_psaun|s:7:"justink";
That's telling me that justink is logged in. Of course, this will depend on session lifetimes and such, but the default settings for PSA limit sessions to something smaller than default php, and raise the GC methods to run much more often as well (The numbers escape me at this moment). Once you have the username, you can use other methods in PSA to get the rest of the information.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do I determine who is logged in? I need to retrieve an array of all the users info, which I could do but I can't figure out how to determine who is actually logged in.
If I needed to find out who was logged in, I'd probably use the psa_sessions table to get that information. The value field has a serialized session array, therefore, you could find something like the following in there:
PSA_psaun|s:7:"justink";
That's telling me that justink is logged in. Of course, this will depend on session lifetimes and such, but the default settings for PSA limit sessions to something smaller than default php, and raise the GC methods to run much more often as well (The numbers escape me at this moment). Once you have the username, you can use other methods in PSA to get the rest of the information.