Skip to content
Browse files

[Security] Add an option to disable the hasPreviousSession() check in…

… AbstractAuthenticationListener
  • Loading branch information...
1 parent b34bdd4 commit 0562463cb79db8bf484644fb59c3f097216dc1a0 @adrienbrault adrienbrault committed Jul 9, 2012
View
1 src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php
@@ -36,6 +36,7 @@
'use_referer' => false,
'failure_path' => null,
'failure_forward' => false,
+ 'require_previous_session' => true,
);
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)
View
3 src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php
@@ -98,6 +98,7 @@ public function __construct(SecurityContextInterface $securityContext, Authentic
'use_referer' => false,
'failure_path' => null,
'failure_forward' => false,
+ 'require_previous_session' => true,
), $options);
$this->logger = $logger;
$this->dispatcher = $dispatcher;
@@ -132,7 +133,7 @@ public function setRememberMeServices(RememberMeServicesInterface $rememberMeSer
}
try {
- if (!$request->hasPreviousSession()) {
+ if ($this->options['require_previous_session'] && !$request->hasPreviousSession()) {
throw new SessionUnavailableException('Your session has timed out, or you have disabled cookies.');
}

0 comments on commit 0562463

Please sign in to comment.
Something went wrong with that request. Please try again.