I've written this code which (i honestly know) is completely inefficient , but anyway... i'm trying to use sessions to determine whether a user is logged in or out... but my super inefficient code isn't doing what i want
here it is..
Problem: When i click on the logoff link, it takes me back to the same option to logoff! and thus it is not recognising that the object has been invalidated when the link was clicked! (although i've tested it to see if it is executing the logoff else statement and it was!) and so if the session has indeed been invalidated, should itbe executing this else statement
Thanks for trying really hard to understand my code HannaH [ December 03, 2007: Message edited by: H Melua ]
I've found it's a lot simpler to test for the existence of an object bound to session than to test for the session itself.
JSPs, by default, create a session so I just assume that there is one and only use getSession() (no arguments) to obtain a reference to it.
Also, these days, it is recommended that this type of logic be factored back into a plain old Java object and controlled from a servlet. Life gets easier once you've moved all of your logic out of the JSPs. [ December 03, 2007: Message edited by: Ben Souther ]