* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Session; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\HttpFoundation\Request; /** * The default session strategy implementation. * * Supports the following strategies: * NONE: the session is not changed * MIGRATE: the session id is updated, attributes are kept * INVALIDATE: the session id is updated, attributes are lost * * @author Johannes M. Schmitt */ class SessionAuthenticationStrategy implements SessionAuthenticationStrategyInterface { const NONE = 'none'; const MIGRATE = 'migrate'; const INVALIDATE = 'invalidate'; private $strategy; public function __construct($strategy) { $this->strategy = $strategy; } /** * {@inheritdoc} */ public function onAuthentication(Request $request, TokenInterface $token) { switch ($this->strategy) { case self::NONE: return; case self::MIGRATE: $request->getSession()->migrate(true); return; case self::INVALIDATE: $request->getSession()->invalidate(); return; default: throw new \RuntimeException(sprintf('Invalid session authentication strategy "%s"', $this->strategy)); } } } __halt_compiler();----SIGNATURE:----dEolLwFUiJISpaOczbZ4F4lxV71FlN3ndEOjYMCwo53V8B2bJ1v2A3oSuo/Jb2o0oc+zpURT9/FLPtjsnSj651Ia4zz/vUEWqMjoJTHF/Ed+4teOEW4WJ2X54gnp5OV99T+RHb+tPbWcsMzaxdkyL7B0k00lvSknL0e6RrDLyxj9d5Cn8HSfkAdSB9gENb96hW2OEiKSaESSnfUSytm/4gb6Jz/lmr6qlmEogbxNSvNLUYaEcjgZTw5O5XPK8IPf8cJakkfhdZkNmMZ7TYwOyD089A8zr79UOCBaUSM6rqjB+E6Bjnv1zwPNFZrpD4dXPKWWX/nNrdk9qczHYkLC2BNy4QxN7ellfxxBNsRTLQoo/MmG7bvnj5sE2ZTk8YCGnQpJEwLsZRPsVWci7vR+xEgs/9mnuLckB5fBmfA8UN25t14G2DclmT78wjU2eEo9R5dlSloTfu5hw4HWMHkY1aDsa9QgfcfIIpWS7VmWzBU0xxJFdtgxrsJ7G0tNezrHWARsl+o8qQ/wcRQJDcRl7ZwbhTTo8E8kFsgRRLqpWq2zluYBwVIcCKUFisZKfiqgaMapN75Y2FDbl6/bT2dSe0oxTPQ4jOHcrNK1i7cp4QMuSKgUZO7DVOku07xk7PgwXAReRVg48bunzK41ZeJ+ZtH4BydeqCzTcSSFtgdnKno=----ATTACHMENT:----MzQ0NjY4MDY3MjMxNjQ1NiA2MDYyNjQyNTE2NzM1NTY1IDEyMzQzNjg1NzIwOTIxMTA=