Arnaud Ad Arnaud Ad - 1 month ago 8x
jQuery Question

Setting cookies on subdomain with jquery

The domain of my website which is, let's say, has a subdomain

When the user clicks on a link on i need to set a cookie on

I tried the following block of code but the cookie is only set on the current domain and not

$.cookie("redirectLanguage", "en", { expires: 365,domain: ''});

thanks for your help!

baseDomain = '',
expireAfter = new Date();

document.cookie="Name="FName"; domain=" + baseDomain + "; expires=" + expireAfter + "; path=/";