Jump to content

Logged out from admin by visiting front on .localhost domain


Zeka
 Share

Recommended Posts

I have moved my local development domain from .local to .localhost and after this, I'm logged out from admin every time I visit the front of the site. I have tested it on several installations. On .local domain I've used  ' $config->sessionFingerprint = 2; '. But on .localhost I have to change it to ' $config->sessionFingerprint = 0;' to solve the issue, but I can't understand why it worked on .local domain, but doesn't on .locahost. 

Do you have any idea what can cause it?  

Thanks, Eugene.

Link to comment
Share on other sites

I don't know either, since I never used .local. But try to add localhost or 127.0.0.1 to your site/config.php file in the "allowed hosts" array. And maybe also delete everything that's inside site/assets/cache and reload everything.

  • Like 2
Link to comment
Share on other sites

On 6/10/2018 at 1:10 PM, dragan said:

I don't know either, since I never used .local. But try to add localhost or 127.0.0.1 to your site/config.php file in the "allowed hosts" array. And maybe also delete everything that's inside site/assets/cache and reload everything.

Jep, and try it in a private window - maybe you have some old session cookies or browser cache / redirects that mess things up.

  • Like 1
Link to comment
Share on other sites

@dragan, @bernhard@Doug G Thanks for answers. Flushing of DNS records helped and now it works with $config->sessionFingerprint = 2;

As for .localhost - I have chosen it as it was reserved for local testing and dev scenarios. 

Is there better domain name for local development? 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Zeka said:

Is there better domain name for local development? 

.test

https://webdevstudios.com/2017/12/12/google-chrome-63/


https://en.wikipedia.org/wiki/Top-level_domain

"RFC 6761 reserves the following four top-level domain names to avoid confusion and conflict.[18] Any such reserved usage of those TLDs should not occur in production networks that utilize the global domain name system:

example: reserved for use in examples
invalid: reserved for use in obviously invalid domain names
localhost: reserved to avoid conflict with the traditional use of localhost as a hostname
test: reserved for use in tests"

  • Like 1
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...