mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 02:10:19 +08:00
23 lines
500 B
PHP
23 lines
500 B
PHP
|
<?php
|
||
|
|
||
|
namespace BookStack\Http\Middleware;
|
||
|
|
||
|
use Closure;
|
||
|
use Illuminate\Session\Middleware\StartSession as Middleware;
|
||
|
|
||
|
class StartSessionIfCookieExists extends Middleware
|
||
|
{
|
||
|
/**
|
||
|
* Handle an incoming request.
|
||
|
*/
|
||
|
public function handle($request, Closure $next)
|
||
|
{
|
||
|
$sessionCookieName = config('session.cookie');
|
||
|
if ($request->cookies->has($sessionCookieName)) {
|
||
|
return parent::handle($request, $next);
|
||
|
}
|
||
|
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|