robcrozier Posted March 27, 2009 Share Posted March 27, 2009 Hi all. Not sure if this is a common question? Can't find the answer i'm looking for in the forum so far however. Basically, i need to make sure that my site's sessions are not being shared between tabs. Can anyone suggest how this can be done, or has onyone accomplished this with a robust solution? Cheers Rob Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/ Share on other sites More sharing options...
Mark Baker Posted March 27, 2009 Share Posted March 27, 2009 Basically, i need to make sure that my site's sessions are not being shared between tabs. Can anyone suggest how this can be done, or has onyone accomplished this with a robust solution?I'd also be interested to know if anybody has found a way of doing this; but as far as I'm aware it isn't possible. Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/#findComment-795049 Share on other sites More sharing options...
aebstract Posted March 27, 2009 Share Posted March 27, 2009 Sessions are per browser window, not tab. Don't think you have a way of making it per tab. Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/#findComment-795056 Share on other sites More sharing options...
Mark Baker Posted March 27, 2009 Share Posted March 27, 2009 I actually looked at a custom session handler that would assign an additional character in the session ID for each tab that was opened, but couldn't get that to work Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/#findComment-795062 Share on other sites More sharing options...
Lyleyboy Posted March 27, 2009 Share Posted March 27, 2009 Its a bit dodgy but couldn't you give the tab an id and suffix the session variables within that tab with the id? Bit crude and dirty but it could work. Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/#findComment-795067 Share on other sites More sharing options...
Mark Baker Posted March 27, 2009 Share Posted March 27, 2009 Its a bit dodgy but couldn't you give the tab an id and suffix the session variables within that tab with the id? Bit crude and dirty but it could work. That was the principle I was working on, which I couldn't get to work... I modified my login screen to test if a basic session already existed; and if so, I assigned an unique ID to the tab before redirecting through to the secondary page which checked if a session file (using the base session ID and the Tab ID) existed, creating one if necessary. The secondary page then allowed the user to select which of several applications they want to access, storing that detail in the new session file.... but I found that it was confusing the original session. Could have been my code, but I didn't have the time to test it further. Quote Link to comment https://forums.phpfreaks.com/topic/151372-session-sharing-between-tabs/#findComment-795074 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.