1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 07:24:27 +02:00
Files
php-flarum/src/Http/SessionAuthenticator.php
Franz Liedke d492579638 Apply fixes from StyleCI
[ci skip] [skip ci]
2019-11-28 00:16:50 +00:00

35 lines
666 B
PHP

<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Http;
use Illuminate\Contracts\Session\Session;
class SessionAuthenticator
{
/**
* @param Session $session
* @param int $userId
*/
public function logIn(Session $session, $userId)
{
$session->regenerate(true);
$session->put('user_id', $userId);
}
/**
* @param Session $session
*/
public function logOut(Session $session)
{
$session->invalidate();
$session->regenerateToken();
}
}