Problems, need help? Have a tip or advice? Post it here.
20 posts Page 2 of 2
larin555 wrote: I find it strange that you would have to edit default browser settings to use a CMS.

Default browser settings should work just fine. My post was not about a pristine clean browser right after installation e.g. fresh unspoiled browser.

It is that people might use various extensions, adblocks, etc. plus customize policy in browser settings to not accept cookies in some cases. I saw that prompt recently on localhost dev domain using a fresh browser with policy set to "strict" and an adblock (uBlock Origin), so what helped me immediately is to turn off protection for the domain. Quite possibly, some browser setting prevents cookies to be written.

That said, my other fix is similar to what KK suggested and perhaps won't work for you. I am attaching it here as an exception and favor (as it is part of the Ryazania pack and not distributed separately) because it won't break anything for anyone if a similar issue pops up for someone. However you'll have to connect this file in kfunctions.php or paste content there — I made it for my pack and will not take responsibility if used elsewhere.

[AP login] skip-cookes-prompt.zip
(828 Bytes) Downloaded 137 times
Hello,

I've tested it, adding the code in the "k_functions.php" file, but nothing changes.

I've received a message from another team member today saying that they emptied their cookies and cache (using Edge) and that now, it shows this error when they want to login.

I told her to open a Private Navigation tab to bypass that error.

There's clearly an issue somewhere, and it's getting important to fix it since my team uses our CouchCMS platform (I built a CRM) every day. Not being able to login is a huge problem for us.

Is there a way maybe to revert the login to the default one, without using the "Extended user" login page?
But making sure we keep all the extended users other features?

Getting over 17k views in a few months on this topic, I'm guessing this would help a lot of other users.

Thank you very much!
I am so sorry for the trouble you are facing. I'd really want to get to the bottom of this issue but cannot do so because it happens only randomly (and hence cannot be reliably recreated for debugging).

Replying to your query -
Is there a way maybe to revert the login to the default one, without using the "Extended user" login page?

Yes, you can easily do so by specifying a blank value for the 'login_tpl' in the '/couch/addons/extended/config.php' used by the addon e.g. the following will use the default screens for login as well as lost-password and registration functions
Code: Select all
// Names of the required templates
$t['users_tpl'] = 'users/index.php';
$t['login_tpl'] = '';
$t['lost_password_tpl'] = '';
$t['registration_tpl'] = '';

Do let us know if this helps.
Hello,

Thanks KK, I tried with the original login page but still showing that cookies error.

For testing purposes, is there a way in the code where I can completly disable that error and bypass the cookie function happening when logging in? Even if it's less secure, I would try it for testing purposes on a local version of the site.

Thanks again
That's weird :?
Are you getting this error consistently now? If yes, please get me access to the site.
As for what you asked, in 'couch/auth/auth.php', find the following code and comment out the second line
Code: Select all
if( isset($_POST['k_cookie_test']) && empty($_COOKIE['couchcms_testcookie']) ){
    return $FUNCS->raise_error( $FUNCS->t('prompt_cookies') );
}

Keep me posted how it goes.
Thanks. I tried commenting out the 2nd line.
The error doesn't show anymore, but it's still happening since it won't log me in.

I understand how hard this can be to debug. Is there maybe a way to completely bypass that cookie rule?
To log me in even if that rule isn't equal to "true".

Thank you
There is no other place where this rule gets enforced.

See, Couch uses cookies for authentication (as do almost all other CMSes) and this test cookie is just a test to see if cookies are working as expected on the system. The test is failing and turning off the test will only mean that you won't see the warning - it won't change the outcome it was warning about; cookies are still not getting set properly on your system and login will fail.

Clearly something is not going right on your system; there has to be something specific on your system(s) that is messing up the regular cookies - some browser addon or an anti-virus or perhaps and that is what needs to be investigated instead on changing the code.
Thanks for the explanation KK.

I understand it seems to be Browser related. That's what I think too, but the fact that it happens on my Mac on Chrome AND Edge (not on Safari), and that after deleting cookies and cache, started happening today for my colleague too who is on Edge (with not special addons), is very strange to me.

If it would only be me, I would understand, but happening to others in the team too is a big issue.
Also, I have a couple of addons on Chrome, but absolutely none on Edge or Safari.
I'm not running any VPN either.

We can pay if needed, but we got to find a way to fix this using code, because I can't get to everyones computer and search for hours and hours what could be the issue especially since we're working remotely.

Thank you again very much
Larin, I trust your application is hosted online and all your colleagues facing the problem are using the same, correct?

If so, please see if there is some kind of caching going on on the server's level (e.g. NGINX or a CDN like Cloudflare).
There could even be some security mod at the server that is messing up with cookies. If caching is involved, then you need to make sure the login/admin pages are excluded from it.

Basically we need to figure out what is causing the cookies to disappear.
You are correct. The Couch installation is on a live server.
I've checked the servers caching settings on our cPanel, and disabled caching completely for our site with Couch installed.
Nothing has changed though.

I am using PHP v7.4 on the server in case it is relevant.

I have another Couch site on our server that is also running, but we never had this issue on that one.

I opened up Edge, checked in the Cookies section, and was able to see 2 cookies for our CRM site.
1 - PHPSESSID
2 - couchcms_testcookie

I tried deleting them both, reloaded the login page and tried to log in, but got the same error again, and those 2 cookies were created back.

Any ideas where to go from there? Thank you very much for your time
20 posts Page 2 of 2