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

Check if user is logged in #9

Closed
mikaint opened this issue Feb 2, 2014 · 2 comments
Closed

Check if user is logged in #9

mikaint opened this issue Feb 2, 2014 · 2 comments

Comments

@mikaint
Copy link

mikaint commented Feb 2, 2014

How can i check if a user is logged in from anywhere in the application?

@coolcsn
Copy link
Owner

coolcsn commented Feb 5, 2014

You have access trough the serviceLocator. $auth = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
if ($auth->hasIdentity()) {
$identity = $auth->getIdentity();
}

@mikaint
Copy link
Author

mikaint commented Feb 5, 2014

great thanks!

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

2 participants