i'm using fosuserbundle and this is my function inside FOSUBUserProvider class :
public function connect(UserInterface $user, UserResponseInterface $response)
{
// and here i want to get session value like:
$session = $request->getSession();
$session->get('value1');
//
}
you need to inject Session in your Services Declaration,
and then add it in constructor of
FOSUserProvider
class,in
services.yml
and services section add@session
declare
$session
and $em variable in your class aboveconnect
function and add following constructor,in function
Connect
you can get it as,