the browser-facing portion of osu!
at master 966 B view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6declare(strict_types=1); 7 8namespace App\Libraries\Session; 9 10class SessionManager extends \Illuminate\Session\SessionManager 11{ 12 /** 13 * Build the session instance. 14 * 15 * @param \SessionHandlerInterface $handler 16 * @return \Illuminate\Session\Store 17 */ 18 protected function buildSession($handler) 19 { 20 return new Store($GLOBALS['cfg']['session']['cookie'], $handler); 21 } 22 23 // copied from upstream but with custom CacheBasedSessionHandler 24 protected function createCacheHandler($driver) 25 { 26 $store = $GLOBALS['cfg']['session']['store'] ?: $driver; 27 28 return new CacheBasedSessionHandler( 29 clone $this->container->make('cache')->store($store), 30 $GLOBALS['cfg']['session']['lifetime'], 31 ); 32 } 33}