首页 > 解决方案 > ADFC-12000:请求中的状态 ID 对于当前会话无效

问题描述

您好,当我第一次登录我的项目时,我在会话中遇到问题,它运行良好,没有任何错误,但是当我注销并再次登录时,这个错误显示给我, ADFC-12000: State ID in request is invalid for the current session. 这是我的注销代码:

      FacesContext context = FacesContext.getCurrentInstance();
                    HttpSession session = (HttpSession)context.getExternalContext().getSession(true);
                    session.invalidate();
                    return "Login.jspx"; ```
i'm using oracle **jdeveloper 12.2.1.4.0**
i need your help
thanks..

标签: javaoracle-adf

解决方案


看起来您保留了请求中的状态。尝试将以下内容添加到您的注销功能中,如果它没有帮助,请查看您的 weblogic.xml > 会话 > 使用查询参数编码会话 ID。

ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
HttpSession session = (HttpSession)ectx.getSession(false);
session.invalidate(); //Should be surrounded with try catch
HttpServletRequest request = (HttpServletRequest)ectx.getRequest();
ServletAuthentication.invalidateAll(request);
ServletAuthentication.killCookie(request); //If you use authentification cookies
return "Login.jspx";

推荐阅读