Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两个接口,在一个接口设置的session,在另一个接口拿不到数据 #346

Closed
lozhu opened this issue Nov 7, 2022 · 1 comment

Comments

@lozhu
Copy link

lozhu commented Nov 7, 2022

登陆之后设置$request->session()->set('user',$user),然后在获取用户信息接口里通过$request->session()->get('user')获取不到数据。。。代码基本上和webman-admin端的差不多,然后复制到app/controller下了,代码不报错。就是获取不到session

@walkor
Copy link
Owner

walkor commented Nov 7, 2022

session依赖cookie,如果客户端不支持cookie或者客户端没有正确传递cookie给webman,那么session将失效。
另外如果使用了nginx代理,并且nginx代理proxy_cookie_path设置了secure;,那么只有https才能正确使用cookie,http无法使用cookie,也会导致session失效。

@walkor walkor closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants