Skip to content

Instantly share code, notes, and snippets.

@xanf
Created June 9, 2011 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xanf/1016389 to your computer and use it in GitHub Desktop.
Save xanf/1016389 to your computer and use it in GitHub Desktop.
<?php
namespace Application\ProdrepBundle\Security;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use FOS\UserBundle\Model\UserInterface;
class RequestListener
{
public function onCoreController(FilterControllerEvent $event)
{
$token = $this->_securityContext->getToken();
if (
null !== $token
&& $token->getUser() instanceof UserInterface
) {
//fixme:
setcookie(
ini_get("session.name"),
session_id(),
time()+ini_get("session.cookie_lifetime"),
ini_get("session.cookie_path"),
ini_get("session.cookie_domain"),
ini_get("session.cookie_secure"),
ini_get("session.cookie_httponly")
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment