I have a Shiro session (id=11111) and a http session (id=22222).
When I try to invalidate the HttpSession, the wrong id is used.
Code:
public void logout() { SecurityUtils.getSubject().logout(); // exception is thrown in this line FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); }
Exception:
java.lang.IllegalStateException: org.apache.shiro.session.UnknownSessionException: There is no session with id [22222]
How can I invalidate the HttpSession or rather set the correct id?
The problem was solved by implementing a HttpSessionBindingListener and create a mapping of Shiro sessions to http sessions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With