Skip to content

Added method User::refresh() to clear identity cache. (#46) #50

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

Merged
merged 2 commits into from
Dec 31, 2020

Conversation

PavelWeirich
Copy link
Contributor

@PavelWeirich PavelWeirich commented Jul 2, 2020

Example in BasePresenter.php:

public function startup()
{
	$this->getUser()->getStorage()->setNamespace('namespace_1');
	.
	.
	.
	$this->getUser()->refresh()->getStorage()->setNamespace('namespace_2');
}

@PavelWeirich
Copy link
Contributor Author

After use, I found a problem with refresh(): each time the page loads, the session_id changes. This is caused by calling $this->storage->getIdentity() in method getIdentity() in Nette\Security\User.php.

Fix - clear $this->authenticated
@dg dg force-pushed the master branch 2 times, most recently from df0693e to 37ca1ea Compare August 2, 2020 16:56
@dg dg force-pushed the master branch 5 times, most recently from 7543e35 to 05709ff Compare October 6, 2020 17:23
@dg dg force-pushed the master branch 3 times, most recently from d183182 to 870e30c Compare October 15, 2020 22:56
@dg dg force-pushed the master branch 4 times, most recently from 3c5a02b to 72ca785 Compare November 2, 2020 16:54
@dg dg force-pushed the master branch 3 times, most recently from f0751cd to 981bdda Compare November 25, 2020 17:50
@dg dg merged commit e74784c into nette:master Dec 31, 2020
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

Successfully merging this pull request may close these issues.

2 participants