Jump to content

[Solved] Refreshing the front end logs me out of the CMS


cjx2240
 Share

Recommended Posts

Hi all

A couple of times now I've run into this issue. Last time I think it went away by itself in the end.

It's making it very difficult to build a site, every time I refresh or load any page on the front-end. I get logged out of the CMS.

I haven't written any code for this site to do with front end logins, logouts, sessions etc.. It happens if my browser's cache is enabled or disabled.

I have the following entries in my session log which I think coincide with it

User '[username]' - Error: Session fingerprint changed (IP address or useragent) (IP: ::1)

I'm not using a VPN

I would appreciate any hints or suggestions as this is getting a little frustrating!

Link to comment
Share on other sites

  • cjx2240 changed the title to Refreshing the front end logs me out of the CMS

Hey @cjx2240

I recognized that this behaviour only occurs when I inspect the website with the dev tools and the "user agent" is changed.

To prevent this I added the following entry in the site/config.php file:

/**
 * Prevent from being frequently logged out while using Chrome DevTools
 * 
 */
$config->sessionFingerprint = 2;

Hope this helps you too.

To make it save for production you could check if $config->debug is true and wrap this with an if query-.

 

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

Oh for crying out loud... you are right... it only happened when I was using the device toolbar from dev tools in Chrome which evidently affects the user agent.

I'm certain this never used to happen, not sure if it's a change in Chrome or the latest version of PW. I'll try out the config setting next time I need it but for now just going back to non-device mode has solved it.

Thanks very much!

Link to comment
Share on other sites

  • cjx2240 changed the title to [Solved] Refreshing the front end logs me out of the CMS
  • 1 year later...
On 10/21/2021 at 12:40 PM, DV-JF said:

Hey @cjx2240

I recognized that this behaviour only occurs when I inspect the website with the dev tools and the "user agent" is changed.

To prevent this I added the following entry in the site/config.php file:

/**
 * Prevent from being frequently logged out while using Chrome DevTools
 * 
 */
$config->sessionFingerprint = 2;

Hope this helps you too.

To make it save for production you could check if $config->debug is true and wrap this with an if query-.

 

Great find!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...