Почему не ставяться куки?
Код следующий
use Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices;
use Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Util\SecureRandom;
//...
public function registrationAction(Request $request)
{
$user = new User();
$form = $this->createForm(new RegistrationType(), $user);
$form->handleRequest($request);
if($form->isValid()){
/...
$providerKey = 'secured_area';
$token = new UsernamePasswordToken($user, null, $providerKey, array('ROLE_USER'));
$this->get('security.context')->setToken($token);
$key = $this->container->getParameter('secret');
$securityRandom = new SecureRandom();
$persistentService = new
PersistentTokenBasedRememberMeServices(array($user), $providerKey, $key, array('path' => '/', 'name' => 'sid', 'domain' => '.site.local', 'secure' => false, 'httponly' => false, 'lifetime' => 31536000, 'always_remember_me' => true, 'remember_me_parameter' => '_remember_me'), null, $securityRandom);
$persistentService->setTokenProvider(new InMemoryTokenProvider());
$response = new RedirectResponse('index');
$persistentService->loginSuccess($request, $response, $token);
}
}
Код ошибок не выдает но и кука не ставиться! В чем ошибка?