页面去除session

来源:互联网 发布:ubuntu qemu xp 编辑:程序博客网 时间:2024/06/11 17:23
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="javax.servlet.http.Cookie" %>
 
<html>
<head>
<link REL=STYLESHEET TYPE="text/css" HREF="tutss.css">
</head>
<body >
<%
    // Destory the token so that the user must logon from the logon page.
    Cookie[] cookies = request.getCookies();
    for ( int i = 0; i < cookies.length; i++ )
    {
        if (cookies[i].getName() == "LogonToken")
        {
            cookies[i].setValue("");
        }
    }
 
    // Logoff and cancel the enterprise session.
    IEnterpriseSession enterpriseSession = (IEnterpriseSession) session.getAttribute("EnterpriseSession");
    session.removeAttribute("EnterpriseSession");
    enterpriseSession.logoff();
    enterpriseSession = null;
    session.invalidate();
    response.sendRedirect("start.jsp");
%>
<p>You have been logged off. To log on again, select a tutorial.</p>
</body>
</html>
0 0
原创粉丝点击