1. When successfully login put the login name into session.
2. In each jsp page get the value from session if you got “!= null” value then Ok
other wise forward to session out page.
3. When ever click logout link disable session value.
It might help you out.