Skip to content

Instantly share code, notes, and snippets.

Avatar

Hans Grinwis hansgrinwis

View GitHub Profile
@hansgrinwis
hansgrinwis / LogoutSubscriber.php
Last active Nov 20, 2020
Symfony JSON logout (json_logout, logout via AJAX call)
View LogoutSubscriber.php
<?php
declare(strict_types=1);
namespace App\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Event\LogoutEvent;