how the heck do i check if a session variable is null?
here is the code doing the work
Code:
// login.jsp: set session var
User u = new User("sde");
session.putValue("user",u);
Code:
// header.jsp: make sure session user is valid
// this always evaluates to true
if( session.getValue("u") != null ){
User u = (User)session.getValue("user");
}else{
response.sendRedirect("../login.jsp");
}
Code:
// logout.jsp
session.invalidate();
after i logout, and go to any page that uses that header file, i can do: out.println(session.getValue("u"), and it prints "null"
i am not using that header file in the login or logout page.