You should store a specific word in the users session from your main entry page, like a login page.
HttpSession session = request.getSession();
session.setAttribute("secr
Then on every page that you only want 'logged in' users you check for the secretWord like this:
if (null != session.getAttribute("secr
// They are logged in
} else {
// They are not logged in, send error message...
}
What this does is check that the session attribute "secretWord" is not null and that it does equal the value "secret". If not, you know they came to the page directly and can then handle it whatever way you want.
Hope that helps,
-Pat
Main Topics
Browse All Topics





by: sbockelmanPosted on 2004-08-14 at 11:51:59ID: 11801237
String sExpectedVariableValue = request.getParameter( "theExpectedVariables" );
if( null == sExpectedVariableValue ) {
// kick them out!
}