Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rememberme cookie path #102

Closed
markleary opened this issue Jan 13, 2017 · 2 comments
Closed

rememberme cookie path #102

markleary opened this issue Jan 13, 2017 · 2 comments

Comments

@markleary
Copy link

Rememberme was not working correctly on my site, because the cookie path was being set to a subdirectory (the url path where users mostly commonly login) rather then the root of the site. The issue seems to be on line 423 of Controller.php:

$cookie->setPath($this->grav['base_url_relative']);

In my instance, $this->grav['base_url_relative'] returns ''. I'm not sure, but this my be related to a closed grav core bug:

getgrav/grav#868

I resolved this by setting $cookie->setPath('/') but that does not seem like a reliable fix.

@flaviocopes
Copy link
Contributor

It probably needs to be

$cookie->setPath($this->grav['base_url_relative'] ?: '/');

so it uses the value of base_url_relative if Grav runs in a subfolder, or / if not.

@rhukster
Copy link
Member

Fixed for next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants