Posts on different topics such as Java, PHP, freelancing, various frameworks and programming principles.
Showing posts with label Security. Show all posts
Showing posts with label Security. Show all posts
Sunday, January 26, 2014
Sunday, May 6, 2012
Symfony2 Security component. How to get the user who is logged-in?
If you are using Symfony2(version 2.0.12 2012-03-19 ) and using Security component then you can get the logged in user like this:
$user = $this->container->get('security.context')->getToken()->getUser();
$user = $this->container->get('security.context')->getToken()->getUser();
Subscribe to:
Posts (Atom)