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

MSM and cookie value problem

Development and Programming

Paw Paw's avatar
Paw Paw
43 posts
15 years ago
Paw Paw's avatar Paw Paw

I have Multi-Site Manger( MSM ) installed for a multi-language site

Default Site: English www.mysite.com Alternate Site: Spanish www.mysite.com/sp

The user is promted to select a language once they enter. This sets a cookie for their language preference, and re-directs them to the appropriate site.

I’m having issues changing the value of the cookie after you have selected a language. The value just isn’t getting passed between sites. i.e. The user is redirected, but the cookies isn’t being set.

The path I’m getting seems to be site specific. i.e. two cookies with two different paths

Note* Both sites access the same javascript file in the root/js/ directory.

Is this a setting in EE? Can I set the path using javascript for both sites?

       
Ingmar's avatar
Ingmar
29,245 posts
15 years ago
Ingmar's avatar Ingmar

What version and build of EE are you using? How is the cookie being set? Using EE?

       
Paw Paw's avatar
Paw Paw
43 posts
15 years ago
Paw Paw's avatar Paw Paw

I’m using Build: 20100810

I set the cookie using Javascript

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
[removed]=c_name + "=" + c_value;

}
       
Lisa Wess's avatar
Lisa Wess
20,502 posts
15 years ago
Lisa Wess's avatar Lisa Wess

Hi, Paw Paw -

Since this is a custom solution, I’m going to move this to Development & Programming for assistance. You might also consider looking at Devot-ee’s language options as an alternative approach.

       
Paw Paw's avatar
Paw Paw
43 posts
15 years ago
Paw Paw's avatar Paw Paw

Thanks, The options seems like way more that I need. I’m just trying to set a cookie successfully from a subdomain

       

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.