\App\MiddlewareCorsMiddleware

CorsMiddleware 跨域中间件 本中间件做了这样一件事,让跨域请求、非跨域请求、api请求,都是用默认的session保持回话,传统请求以外的请求 通过header传输sessionid来保持会话,由于框架底层写死了HYPERF_SESSION_ID这个key,所以沿用…… 这样做必须满足两个条件:1、服务端开启cors_access允许跨域 2、客户端实现HYPERF_SESSION_ID的存储 当然如果cookie有值,优先使用cookie值

Summary

Methods
Properties
Constants
__construct()
process()
No public properties found
No constants found
No protected methods found
$container
N/A
No private methods found
$config
N/A

Properties

$container

$container : \Psr\Container\ContainerInterface

Type

\Psr\Container\ContainerInterface

$config

$config : \Hyperf\Contract\ConfigInterface

Type

\Hyperf\Contract\ConfigInterface

Methods

__construct()

__construct(\Psr\Container\ContainerInterface  $container) 

Parameters

\Psr\Container\ContainerInterface $container

process()

process(\Psr\Http\Message\ServerRequestInterface  $request, \Psr\Http\Server\RequestHandlerInterface  $handler) 

Parameters

\Psr\Http\Message\ServerRequestInterface $request
\Psr\Http\Server\RequestHandlerInterface $handler