Continual logout in cbadmin

Setting up a new site, latest contentbox, ACF 2018 via commandbox, and when navigating inside the cbadmin it randomly redirects me to the login page. Often at that point I can log in, but other times when I submit the login form it simply redirects to the login page. No error, no messages. If I clear my cookies (chrome), it often will allow me to login, but not always.

In the logs I see this a lot:
Error decrypting Keep Me Logged in key: Variable COOKIEVALUE is undefined.

This error is raised because when cbStorage retrieves the cookie “contentbox_keep_logged_in” it returns null. Not sure why. Cookies are enabled in CF Admin and seems to happen at random. I’ve had report of this behavior from several users using various browsers, so pretty sure it’s not a client side cookie issue.

To work around I’ve changed contentbox/models/security/SecurityService.cfc’s getKeepMeLoggedIn() method from:
var cookieValue = cookieStorage.get( name=“contentbox_keep_logged_in”, default="" );
var cookieValue = cookieStorage.get( name=“contentbox_keep_logged_in”, default="" )?:"";

Seems to work, but again, I’m not sure what the underlying issue was so I feel like I’m just masking the real problem. Any ideas/suggestions?

1 Like

Interesting that the default value isn’t being used. Ahh, here is the likely problem. The API of the get() method was changed in the latest version of cbstorages. default is now called defaultValue to get around Adobe’s terrible parser.

So the default value basically isn’t being used. Please enter a ticket for ContentBox to fix its usage of cbstorages.

Thanks Brad, good catch. I’ll open a ticket. At least it confirms my workaround wasn’t too far off base.

1 Like

This is resolved in BE already.

1 Like