datadoit
|
| Posted: 09/18/2008, 11:15 AM |
|
CCS3.2; PHP5; MySQL5; CentOS4.6; Apache2
What is the best method given the environment above for managing
multiple user sessions? Here's our current scenario:
User A browses to site and logs in. Each time User A goes to the site
again in a new browser window, they're already logged in.
That's actually not the worst thing in the world. The problem comes
when User A logs off in one of those windows, they're subsequently
logged off in all window sessions. That of course is because their
session of "UserID/UserLogin/GroupID" is set to a blank value. We're
finding that this is aggravating some folks, mainly because I always
yell at them for closing the windows instead of "Logging Off". :)
How can these sessions be set with a predetermined, prefixed SESSION ID?
Doesn't Apache give out a pre-set session ID somewhere? I then could
prepend that value to the session values as such:
CCSetSession(SESSION_ID . "UserID", $Container->login->GetValue());
Another benefit that could come from this would be the ability, as an
administrator, to log in as that user on-the-fly to see their environment.
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 09/19/2008, 12:20 AM |
|
Are you sure the user opens a new browser instance or is he using a new tab in current browser "only"?
A new Browser instance should open another session a new tab on the other hand should still use the current session.
_________________
Best regards,
Michael |
 |
 |
datadoit
|
| Posted: 09/19/2008, 5:43 AM |
|
A new browser window (or tab) opens the same session id and session
name. The old browser window then inherits any new session information
from that new browser window. Now if you open Firefox, then go and open
IE, you will have two different sessions.
I've done a lotta reading on this since I originally posted, and
discovered that what I want is NOT an easy thing to do within
CodeCharge. Will require a whole lot of mucking around with the way CCS
is setting and managing sessions, and I just don't have time for that in
the midst of college football season. :)
|
|
|
 |
mentecky
Posts: 321
|
| Posted: 09/20/2008, 8:57 AM |
|
datadoit,
I had the reverse problem. I couldn't get sessions to line up when I wanted, but maybe my problem can be part of your solution. Sessions are attached to a root path... so if you change that, or even add a sub domain, you can have multiple sessions on the same server.
The other thing I have done is rather than store session vars I used a table in a DB. I had to do this once to get ASP and PHP to play nice together. ASP and PHP create seperate sessions. I used IP addy and username to key that table. That way I could access the vars from either language. It was a pain because it needed extra timeout code and such, but it worked.
Hope that gives you some inspiration,
Rick
_________________
http://www.ccselite.com |
 |
 |
datadoit
|
| Posted: 09/21/2008, 4:29 PM |
|
I'll look deeper into the database session management.
Thanks!
|
|
|
 |
ColinA
Posts: 9
|
| Posted: 10/06/2008, 6:38 PM |
|
mentecky
Where did you insert the session_save_path and session.save_handler?
A good source of info on PHP sessions is http://au.php.net/manual/en/book.session.php
_________________
Col |
 |
 |
|