Convert SessionManager to a factory class

This commit is contained in:
Pierre Rudloff 2020-10-21 22:47:15 +02:00
parent 5b0ee7651b
commit de8c5e5dc7
10 changed files with 64 additions and 52 deletions

View file

@ -0,0 +1,27 @@
<?php
/**
* SessionFactory class.
*/
namespace Alltube\Factory;
use Aura\Session\Session;
/**
* Manage sessions.
*/
class SessionFactory
{
/**
* Get the current session.
*
* @return Session
*/
public static function create()
{
$session_factory = new \Aura\Session\SessionFactory();
return $session_factory->newInstance($_COOKIE);
}
}