0

Session invalidate in 6.0.2

asked 2014-10-13 14:52:03 +0800

abcd123 gravatar image abcd123
17 3

updated 2014-10-13 16:43:18 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9
https://github.com/chillw...

Hello forum!

after updating from 5 to 6, the way in which I invalidate a session during login to my application does not work ( throws Exception, see below ).

I invalidate the session using:

  execution.getNativeRequest().getSession().invalidate()

next I create new session:

execution.getNativeRequest().getSession(true);

finally I call a redirect:

   execution.sendRedirect("/");

Execution then continues and eventually ends up with the exception:

SEVERE: 
java.lang.IllegalStateException: getAttribute: Session already invalidated
    at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032)
    at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
    at org.zkoss.zk.ui.http.SimpleSession.getAttribute(SimpleSession.java:204)
    at org.zkoss.zk.ui.http.SimpleSession.getAttribute(SimpleSession.java:238)
    at org.zkoss.zk.ui.impl.DesktopImpl.getAttribute(DesktopImpl.java:608)
    at org.zkoss.zk.ui.impl.PageImpl.getAttribute(PageImpl.java:377)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:866)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zk.ui.AbstractComponent.getAttribute(AbstractComponent.java:864)
    at org.zkoss.zul.Image.renderProperties(Image.java:310)
    at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:1809)
    at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:1886)
    at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:1828)
    at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:1886)
    at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:1828)
    at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:1886)
    at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:1828)
    at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:1886)
    at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:1828)
    at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:946)
    at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:643)
    at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1408)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1220)
    at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:558)
    at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:456)
    at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:464)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

NOTE: this didnt happen in zkoss 5, it only appeared after update to 6.

I am getting pretty desperate resolving this issue so will be very happy to hear your ideas.

( btw. the tags available to me while poting the question are completely useless ... )

Thanks!

delete flag offensive retag edit

Comments

added session tag, you want other tags to?

chillworld ( 2014-10-13 14:58:14 +0800 )edit

thank you, yes please add 'update issue' or something along similar lines. also '6.0.2' :)

abcd123 ( 2014-10-13 15:03:13 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-06 08:56:58 +0800

hawk gravatar image hawk
2455 1 5
http://hawkphoenix.blogsp... ZK Team

maybe you should use http://www.zkoss.org/javadoc/7.0.3/zk/org/zkoss/zk/ui/Session.html#invalidate()

link publish delete flag offensive edit
0

answered 2015-01-12 15:16:31 +0800

abcd123 gravatar image abcd123
17 3

Thanks for your reply, but that didnt work for me. In the end I had to write a workaround filter to getaround this issue unfortunately.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-10-13 14:52:03 +0800

Seen: 25 times

Last updated: Jan 12 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More