0

i am using the loginpage which does not come in frame but once i logged in all the pages are in framset and when i try to log out (the logout link is there in the frame) only that specific frame is reloaded and the login page comes to that frame. but i want the login page to be displayed where no pages should be displayed.

i remove session values like this, but when i refresh the page all the valuse are there in pages which are there in the frame.

public void sessionRemove(HttpServletRequest request,HttpServletResponse response){
        request.getSession(true).removeAttribute("userDetails");

        /**
         * Remove the Session Object.
         */
        Enumeration enumSessionObj = request.getSession(false).getAttributeNames();
        while(enumSessionObj.hasMoreElements()){
            String enumObj = enumSessionObj.nextElement().toString();
            request.getSession(false).removeAttribute(enumObj);
        }

        /**
         * Remove the Cookies.
         */
        Cookie[] cookies = request.getCookies();
        for (int i = 0; i < cookies.length; i++) {
            Cookie delCookie = cookies[i];
            delCookie.setMaxAge(0);
        }
    }

How to do this ,

Please help

Java Questions
  • 7,813
  • 41
  • 118
  • 176

1 Answers1

1

Could you try?:

    request.getSession().invalidate();

Could you print the time in one of those frames. I think your problem could be cache related.

If you session is invalidated you can do a number of things. Ex. fowarding the user to another page. Or refreshing your frames with javascript just like this.

            window.parent.MY_FRAME_NAME.location.reload();

Good luck;

PbxMan
  • 7,525
  • 1
  • 36
  • 40
  • removes the session value what about the frames – Java Questions Oct 23 '12 at 09:36
  • I think you may need to refresh them, and problably check if the session is still valid. You can also redirect them to another location for login. It's up to you. Good luck! – PbxMan Oct 23 '12 at 09:54
  • :) i redirect to another login page, the login page also comes but it is there in the top frame from where the request is sent – Java Questions Oct 23 '12 at 10:02