播放框架不会使用安全模块注销 [英] play framework won't logout with secure module

查看:59
本文介绍了播放框架不会使用安全模块注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a problem when I do logout. Basically I am using the secure module, i call to the method secure.logout(), this redirect to login page, but i can do back and come back to the page, as if I am logued.

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();
}

我正在使用最后一个代码,其中包括删除cookie,这已经有一段时间了,但是现在不再起作用了.

I am using the last code, I was including the removing cookies, for a while it worked, but now no longer work.

有人对此有解决方案.非常感谢您的帮助.

Somebody have a solution for that. I appreciate so much your help.

推荐答案

我要说的是,这是因为当您单击后退"时,您正在访问导航器的缓存.尝试在此未经授权的页面上点击刷新",您将发现Play实际上并未在该页面上投放广告.

I would say that this is because when you hit "back" you are accessing the cache of your navigator. Try to hit "refresh" on this unauthorised page and you will that Play is not actually serving the page.

本文包含有关此主题的有趣信息: http://www.codeproject.com/Tips/549347 /浏览器后退按钮问题退出后

This article contains interesting information on the subject: http://www.codeproject.com/Tips/549347/Browser-Back-Button-Issue-After-Logout

这篇关于播放框架不会使用安全模块注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆