Hi, according to license agreement I can you one license for one top domain. But how can I use currentOrderId between two subdomains?
For now we have 2 websites:
demosite.local store.demosite.local
And I whould loke to see updated ''mini cart" on both websites. I enabled "Use Cookies", but found that when server send cookies to browser cookie don't have correct domain.
Now it is demosite.local but should be .demosite.local to make sure it will work on both.
public class CookiesChangeModule : IHttpModule { public void Init(HttpApplication context) { context.PreSendRequestHeaders += new EventHandler(this.OnPreSendRequestHeaders); }
Cookies not shared between sub domains
Hi, according to license agreement I can you one license for one top domain. But how can I use currentOrderId between two subdomains?
For now we have 2 websites:
demosite.local
store.demosite.local
And I whould loke to see updated ''mini cart" on both websites. I enabled "Use Cookies", but found that when server send cookies to browser cookie don't have correct domain.
Now it is demosite.local but should be .demosite.local to make sure it will work on both.
Any Idea how can I solve this issue?
Thanks!.
I know we have had that working in Tea Commerce v1, but i personally never tried it in v2. We will have a look at it and get back to you.
/Rune
Hi, I already checked by Reflector and found that domain not set at all by code. So context donain are used.
I found temporary solution. See bellow.
public class CookiesChangeModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.PreSendRequestHeaders += new EventHandler(this.OnPreSendRequestHeaders);
}
public void Dispose()
{
}
private void OnPreSendRequestHeaders(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
foreach (string cookieName in context.Response.Cookies)
{
if (cookieName.StartsWith("teacommerce"))
{
HttpCookie cookie = context.Response.Cookies[cookieName];
cookie.Domain = ".demosite.local";
break;
}
}
}
}
Thanks for fast response. I thisk it will be fixed soon by TeaCommerce)
You can use the httpCookies in the web.config - see this link: http://patrickdesjardins.com/blog/httpcookie-and-web-config-domain
Kind regards
Anders
is working on a reply...