
the problem is -- when i logout , the user goes to logout.jsp (as simple), but when he presses back button , he again sees the page , where he has come from .. please get me out of this problem thanks.

Use session.invalidate() method to close the session.Here is an example.
1)login.jsp:
<html> <head> <title>User Login</title> </head> <br> <body Bgcolor ="#0099cc"><hr><hr> <form method="POST" action="action.jsp"> <p><b>UserName:</b> <input type="text" name="UserName" size="10"></p> <p><b>Password:</b> <input type="Password" name="Password" size="10"></p> <p><input type="submit" value="Submit" name="submit"><input type= "reset" value="Reset" name="reset"></p><hr><hr> </form> </body> </html>
2)action.jsp:
<%@page import="java.util.*" %>
<script>
function go() {
window.location.replace("logout.jsp",'window','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
self.close()
}
</script>
<%String str = request.getParameter("UserName");
session.setAttribute("UserName", request.getParameter("UserName"));%>
Welcome to <%= session.getAttribute( "UserName" ) %>
<% if (session.getAttribute("UserName").equals("")){%>
<a href="login.jsp"><b>Login </b></a>
<%}
else{%>
<a href="javascript:go()"><b>Logout</b></a>
<%}
%>
3)logout.jsp:
<%session.invalidate();%> You have logged out. Please <a href="a.jsp"><b>Login</b></a>

can you please explain me -- what's actually happening in function go() ...?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.