1 | <?php |
||
35 | class SessionHandler |
||
36 | { |
||
37 | const SESSION_ATTRIBUTE = Session\Session::class; |
||
38 | |||
39 | /** |
||
40 | * Session factory |
||
41 | * |
||
42 | * @var Session\SessionFactory |
||
43 | * |
||
44 | * @access protected |
||
45 | */ |
||
46 | protected $sessionFactory; |
||
47 | |||
48 | /** |
||
49 | * Create a session handler |
||
50 | * |
||
51 | * @param SessionFactory $sessionFactory Session factory |
||
52 | * |
||
53 | * @access public |
||
54 | */ |
||
55 | public function __construct(Session\SessionFactory $sessionFactory = null) |
||
59 | 1 | ||
60 | /** |
||
61 | * Create Session stores it on the specified request attribute |
||
62 | * |
||
63 | * @param Request $request PSR7 Request |
||
64 | * @param Response $response PSR7 Response |
||
65 | * @param callable $next Next callable middleware |
||
66 | * |
||
67 | * @return Response |
||
68 | * |
||
69 | * @access public |
||
70 | */ |
||
71 | public function __invoke(Request $request, Response $response, callable $next) |
||
77 | |||
78 | 1 | /** |
|
79 | * Create new session |
||
80 | * |
||
81 | * @param Request $request PSR7 Request |
||
82 | * |
||
83 | * @return Session\Session |
||
84 | * |
||
85 | * @access protected |
||
86 | */ |
||
87 | protected function newSession(Request $request) |
||
93 | } |
||
94 |