Syphon Posted April 30, 2008 Share Posted April 30, 2008 Can a session variable created for user A be accessed by user B? Much like the way .NET handles sessions in global.asax Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Simply: No. Quote Link to comment Share on other sites More sharing options...
corbin Posted April 30, 2008 Share Posted April 30, 2008 Hrmmm... Yes it's possible.... It would have to be ghetto though.... There's no $_SESSION['usera'] or anything. Need a lot more info though. How do you know which user's info you want user b to access and so on.... Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 It's possible with a database, but it's very convoluted. That wasn't the original intention of sessions. Quote Link to comment Share on other sites More sharing options...
corbin Posted April 30, 2008 Share Posted April 30, 2008 It's possible without a database too... But yes.... Sessions weren't meant to do this, and if I were the OC, I would avoid it at all costs. Quote Link to comment Share on other sites More sharing options...
Syphon Posted April 30, 2008 Author Share Posted April 30, 2008 If it's not meant to be then I'll work without it. FYI The scenario was if an administrator edited a users (currently logged in) personal information. A user object with all that users information is stored in the session and would be out of sync with the database. Not a huge issue, but I was curious if there was a proper solution. Sounds like it's not worth the trouble. Thanks. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Just make a function that updates their user info whenever they access a page that they need it for...but wait...their ID will never change, so you don't really need to update their session...>_> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.