mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
30 lines
622 B
PHP
30 lines
622 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Session;
|
|
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
|
|
|
|
class EncryptCookies extends BaseEncrypter
|
|
{
|
|
/**
|
|
* The names of the cookies that should not be encrypted.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $except = [
|
|
//
|
|
];
|
|
|
|
public function handle($request, Closure $next)
|
|
{
|
|
if (isset($_COOKIE['uid']) && isset($_COOKIE['token'])) {
|
|
Session::put('uid' , $_COOKIE['uid']);
|
|
Session::put('token', $_COOKIE['token']);
|
|
}
|
|
|
|
return parent::handle($request, $next);
|
|
}
|
|
}
|