We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Session across MSM

Development and Programming

David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

I’m trying to pass information across MSM with the session_id but there seems to be a strange issue. The primary site always returns the correct session_id however the other sites return a different sid value on every page load. To test I’m running a simple function through an extension test… Below is a copy of the function.

function sid(){
    return $this->EE->session->userdata['session_id'];
}

Why are the other sites generating a new session_id value on each page load?

Thanks, David

       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

After looking into this a bit more I now realize that I was trying to use this in the wrong fashion. So is there a way to share a key value across multiple sites with EE? I’m trying to create a MSM module and need to be able to pass sessions for both guests and logged in users.

Thanks, David

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
15 years ago
Pascal Kriete's avatar Pascal Kriete

Logged in users are simple (as long as they are logged in to all sites) - you always have the same user id and unique id.

For guests you will need some trickery to make it work. Session ids are periodically regenerated, so you can’t rely on those. They’re also not the same across sites (as you’ve seen).

Are these sites on the same domain (different subdomains)? Or are they completely separate?

Are you trying to have persistent data that is in sync across sites or is it a redirect that only needs to pass it for one request?

       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

Figured out a solution with a cookie since all of the sites are subdomains of the main site.

Thanks for your reply!

Best, David

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.