I show a message:
"You are not logged in"
for guests who click a button "submit" on my page. Surely, for logged in users I want to not show the message. I coded this in this way:
<c:if test="${someCondition}">
addMsgToButtonEvent();
</c:if>
It works (almost) perfectly. But, now when user is logged in and:
- click sign out (which is in my header and redirects on another page)
- click "Back" button on the browser
The message doesn't appear because my page is not rendered again, addMsgToButtonEvent
is not called. I know that I can block "back" button by clearing a history - but this would change too much in business requirements. Is this some soft and effective workaround on this problem?
Edited:
I think the best approach for such problem is invalidating session after sign out. I did it in this way.