Playframework play framework不会使用安全模块注销

Playframework play framework不会使用安全模块注销,playframework,Playframework,我注销时遇到问题。基本上,我使用的是安全模块,我调用secure.logout方法,这重定向到登录页面,但我可以返回并返回页面,就像我被登录一样 public static void logout() throws Throwable { Security.invoke("onDisconnect"); session.clear(); response.removeCookie("rememberme"); for(String key :

我注销时遇到问题。基本上,我使用的是安全模块,我调用secure.logout方法,这重定向到登录页面,但我可以返回并返回页面,就像我被登录一样

public static void logout() throws Throwable {
    Security.invoke("onDisconnect");        
    session.clear();

    response.removeCookie("rememberme");

    for(String key : response.cookies.keySet()){
        response.removeCookie(key);
    }
    response.reset();

    Security.invoke("onDisconnected");
    Secure.login();
}
我正在使用上一个代码,我包括删除cookies,有一段时间它工作了,但现在不再工作


有人能解决这个问题。我非常感谢你的帮助

我想说这是因为当你回击时,你正在访问导航器的缓存。尝试点击这个未经授权的页面上的刷新,你会发现Play实际上并没有服务于该页面

本文包含有关该主题的有趣信息:

您要返回的控制器是否带有@Secure注释?