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过期,客户端不能正常登出 #17

Open
jc91715 opened this issue Apr 18, 2018 · 3 comments
Open

服务端session过期,客户端不能正常登出 #17

jc91715 opened this issue Apr 18, 2018 · 3 comments

Comments

@jc91715
Copy link

jc91715 commented Apr 18, 2018

leo你好

当服务端sessio过期时,此时用户停留在客户端登录后的页面。
这时当用户点击退出按钮时,报错

session_destroy(): Session object destruction failed

我的代码

 $this->initCAS();
  phpCAS::logoutWithRedirectService(route('welcome'));

当我试图用捕获错误的方法不终止代码运行,重定向到欢迎页

try{
                    $this->initCAS();
                    phpCAS::logoutWithRedirectService(route('welcome'));
                    info('cas成功登出');
                    return;
                }catch(\Exception $e){
                    info('cas error');
                    info($e->getMessage());
                }
                return redirect()->route('welcome');

此时页面返回
image

是否有个接口去判断服务端的session已经过期?之后在进行其他操作

@jc91715 jc91715 changed the title 服务端session过期,不能客户端正常登出 服务端session过期,客户端不能正常登出 Apr 18, 2018
@leo108
Copy link
Owner

leo108 commented Apr 19, 2018

session_destroy(): Session object destruction failed 这个错误是哪个端报的?server 还是 client

@jc91715
Copy link
Author

jc91715 commented Apr 19, 2018

在客户端

info($e->getMessage());

在日志里看到 session_destroy(): Session object destruction failed

手动清除浏览的cookie,然后点击登出按钮,这个错误会重现

@leo108
Copy link
Owner

leo108 commented Apr 19, 2018

目测是 client 端 phpCAS 的问题,和 server 端无关

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