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

Session lazy load #96

Open
vitalyzhakov opened this issue Oct 12, 2016 · 2 comments
Open

Session lazy load #96

vitalyzhakov opened this issue Oct 12, 2016 · 2 comments

Comments

@vitalyzhakov
Copy link

vitalyzhakov commented Oct 12, 2016

If I insert login form, application start session, but user does not authorized.
How can I disable start session for anonymous users?

@vitalyzhakov
Copy link
Author

After debug I find line, which starting session
https://github.com/Nodge/yii2-eauth/blob/master/src/ServiceBase.php#L133

@vitalyzhakov
Copy link
Author

vitalyzhakov commented Oct 13, 2016

So, code may be changed to

if (Yii::$app->session->hasSessionId) {
        $returnUrl = Yii::$app->getUser()->getReturnUrl();
} else {
        $returnUrl = Url::to();
}
$this->setRedirectUrl($returnUrl);

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

1 participant