php_cas_server icon indicating copy to clipboard operation
php_cas_server copied to clipboard

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

Open jc91715 opened this issue 7 years ago • 3 comments

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 avatar Apr 18 '18 10:04 jc91715

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

leo108 avatar Apr 19 '18 09:04 leo108

在客户端

info($e->getMessage());

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

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

jc91715 avatar Apr 19 '18 10:04 jc91715

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

leo108 avatar Apr 19 '18 15:04 leo108