Hi
I switched from the old member module to the new extended user module in v1.45, and immediately started having the 'cookie problem' - attempts to log in frustrated by an apparently erroneous error message 'Cookies must be enabled to use this CMS' even though cookies are enabled.
So I took a closer look.
I found that the error message always appeared on the first attempt to log in, but not after that. So I looked at auth.php, and experimented a bit with selectively deleting cookies, and found that the problem is with the test cookie. In auth.php, a test cookie is set and later retrieved - and if it's not there then the error message is generated.
The problem is explained under 'Common pitfalls' in the PHP documentation at http://php.net/manual/en/function.setcookie.php. The page has to be reloaded after the test cookie is set; otherwise it can't be retrieved. Somehow, my log-in form was invoking auth.php in a way that didn't involve the necessary page reload.
My workaround is to set the test cookie before the form is submitted, rather than waiting for auth.php to set it after the form is submitted. So, in the log-in template I include the tag
before the form tag. So far, it works!
I hope this might be useful if anyone else is having this problem with the new release.
Cheers
David
I switched from the old member module to the new extended user module in v1.45, and immediately started having the 'cookie problem' - attempts to log in frustrated by an apparently erroneous error message 'Cookies must be enabled to use this CMS' even though cookies are enabled.
So I took a closer look.
I found that the error message always appeared on the first attempt to log in, but not after that. So I looked at auth.php, and experimented a bit with selectively deleting cookies, and found that the problem is with the test cookie. In auth.php, a test cookie is set and later retrieved - and if it's not there then the error message is generated.
The problem is explained under 'Common pitfalls' in the PHP documentation at http://php.net/manual/en/function.setcookie.php. The page has to be reloaded after the test cookie is set; otherwise it can't be retrieved. Somehow, my log-in form was invoking auth.php in a way that didn't involve the necessary page reload.
My workaround is to set the test cookie before the form is submitted, rather than waiting for auth.php to set it after the form is submitted. So, in the log-in template I include the tag
<cms:set_cookie 'couchcms_testcookie' 'CouchCMS test cookie' />
before the form tag. So far, it works!
I hope this might be useful if anyone else is having this problem with the new release.
Cheers
David