Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Crowdy 40 posts 111 karma points
    Sep 06, 2021 @ 12:01
    Paul Crowdy
    0

    Multiple sub domains

    Hi Matt,

    I have a requirement to run multiple sub-domains within a single Umbraco instance, all referencing the same Vendr store.

    eg.

    • www.domain.com
    • books.domain.com
    • dvds.domain.com

    Should all reference the same Vendr store, and have the same basket/vendr session. The Vendr cookie is currently being created independently for each sub domain. How can I set the cookie domain to ".domain.com"?

    Thanks,

    Paul.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 06, 2021 @ 12:34
    Matt Brailsford
    0

    Hey Paul,

    Hmm, that interesting. Going by the subdomains you have a store per product type? How would the basket work in this scenario? If you added books from the books domain, and then went to the dvds domain, are you still meant to be able to checkout with the different types of item?

    We don't currently have a way of setting the domain on the cookie. Best I can think right now is if there is a way to hook into the request pipeline, just before returning, see if there is a Vendr cookie and if there is, set it's domain property. I'll maybe have to add a web.config setting for this in the future.

    Matt

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 06, 2021 @ 12:40
    Matt Brailsford
    100

    Just googled, and I think you might be able to use this in the web.config

    <system.web>
       <httpCookies domain=".domain.com"/>
    </system.web>
    
  • Paul Crowdy 40 posts 111 karma points
    Sep 06, 2021 @ 12:49
    Paul Crowdy
    0

    Matt,

    Yes, the sub domains I gave were just an example, but in terms of functionality:

    books.domain.com & dvds.domain.com

    should function in exactly the same was as if they were browsed/added to basket from:

    www.domain.com/books & www.domain.com/dvds.

    The httpCookies solution seems to nave worked nicely - thank you!

Please Sign in or register to post replies

Write your reply to:

Draft