We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10239
    • 8 Posts
    Does anybody know how to do this with modx revolution ?

    Wordpress seems to have a setting to limit the setting of cookies to www.domain.com in stead of domain.com
    it does that by adding the following line to wp-config.php
    define(’COOKIE_DOMAIN’, ’www.example.com’);

    In order to set up a cookieless subdomain I have to make sure that modx only sets cookies for www.example.com and not the top-level example.com. (Cookies set at the top-level domain apply to all subdomains as well.)

    Anybody know how to do this in modx revolution?
      • 26016
      • 561 Posts
      I honestly don’t know, but a quick question that may help someone answer this... can I construe that forcing "www" via .htaccess won’t give you what you need? This is the easiest idea that comes to mind.

      Cheers
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 22303 MODX Staff
        • 10,725 Posts
        Yes, redirect all requests to the non-www URL before it gets to MODx. You can also limit the cookies by creating a system (or context) setting with the key session_cookie_domain and a value of www.domain.tld, but that will not prevent access to the non-www URL; it will just prevent the user from ever being able to login or access their session when using the non-www URL.