We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41327
    • 3 Posts
    Good day, help setup or explain what the problem is.
    I read everything what I could find about settings subdomains, also about setting sessions, but I can't understand what the problem is.

    System features:
    MODX Revolution 2.2.7-pl
    PHP Version 5.3.24
    MySQL 5.5.25

    The idea is as follows. Have a domain: domain.com
    added and setting two subdomains: sub1.domain.com, sub2.domain.com
    It is established:
    session_cookie_domain: .domain.com

    Login snippet call:
    [[!Login? &contexts = `web,sub1,sub2`]]


    Task of is as follows that the user can Login from the main site: domain.com and access to resources: sub2.domain.com
    Also, the user can Login from subdomains: sub1.domain.com and access to resources: sub2.domain.com

    Resources sub2.domain.com divided into groups by.

    The problem is this, when the user Login on a domain or subdomain (everything is fine).But moving to a different subdomain or domain, user need again Login. And most interestingly, there is a come back to login Page. Domain or subdomain asked Login again

    In Login &contexts = `web,sub1,sub2` - tried all possible options.
      • 41327
      • 3 Posts
      I found what the problem is, if you disable the following variables

      suhosin.session.cryptdocroot = Off
      suhosin.cookie.cryptdocroot = Off


      then it works. There is a bug in PHP which is described here https://bugs.php.net/bug.php?id=43682&edit=1

      need your advice about safety [ed. note: nikada last edited this post 13 years, 5 months ago.]
        • 45008
        • 2 Posts
        sobchukvadim Reply #3, 13 years ago
        where it is necessary to write?
        Quote from: nikada at May 15, 2013, 06:21 AM
        I found what the problem is, if you disable the following variables

        suhosin.session.cryptdocroot = Off
        suhosin.cookie.cryptdocroot = Off


        then it works. There is a bug in PHP which is described here https://bugs.php.net/bug.php?id=43682&edit=1

        need your advice about safety
          • 41327
          • 3 Posts
          Disabling the encryption

          Obviously you can edit your php.ini to disable the whole encryption or only the docroot part if you have access to the server.

          If you don't, and the server is running apache, try disabling it in the .htaccess file of your php app's root like this:

          php_flag "suhosin.session.cryptdocroot" 0
          If its working you should see the differenc in the phpinfo() output. (Local value column)

          If your host doesn't allow a .htaccess file, you can set the same variable in php, but its important to do it before session_start(). Hopefully you have some kind of a front controller to place this in.

          ini_set('suhosin.session.cryptdocroot', 0);
          phpinfo();
          The output of the phpinf should be same as in the .htaccess method, cryptdocroot line with an "Off" local value.