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 Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/ Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Simply: No. Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530682 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.... Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530684 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. Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530685 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. Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530686 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. Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530696 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...>_> Link to comment https://forums.phpfreaks.com/topic/103635-solved-global-session-access/#findComment-530697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.