Session Timeout problem (maybe it's hiden minimum time session involved)

asked 2012-06-07 15:36:35 +0800

Gostev gravatar image Gostev
15 1

Hello fellows!

My point is to set session timeout for 1 minute, and ZK to redirect user to Login page after it.
That's my code in zk.xml:


In reality after 1 minute nothing happens, but in 5-10 min's after action performed, I have message about session timeout.
1) Why not after 1 minute as I've pointed
2) Message pops after my action, not automatic
3) Why not redirecting me to WEB-INF/login.zul

Maybe I miss something, or some hidden rules involved, if you can guess, please let me know.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-06-08 03:32:46 +0800

rdgrimes gravatar image rdgrimes
735 7

I had trouble with the session-timeout as well, when placed in the zk.xml. So, I moved it to web.xml and it seemed to work better. The difference is, per ZK documentation, the session-timeout in zk.xml is the idle seconds between client requests that invalidates the session. Since it doesn't work as expected, I suspect there is a bug or maybe it is some background communication going on between client and server, within the ZK framework, that they are counting erroneously as a client request.

Anyway, try moving that piece of the session-config to web.xml. Remember the session-timeout value in web.xml is in minutes, not seconds. Anyway, it worked for me by moving the value there.

One more thing. I'm not sure if .zul views are http accessible when placed in WEB-INF. Try placing it directly below WebContent and redirect it that way. That might be part of your problem.

link publish delete flag offensive edit

answered 2012-06-11 10:14:12 +0800

Gostev gravatar image Gostev
15 1

updated 2012-06-11 10:14:33 +0800

Thank you rdgrimes.I have get rid of all tiomeout stuff from zx.xml and set timeout in web.xml. Working stable. Unfortunately this way I can't rely on advanced features ZK propose, like customized message or automatic timeout.

link publish delete flag offensive edit

answered 2012-06-11 15:34:14 +0800

rdgrimes gravatar image rdgrimes
735 7

You can still use those features. You only need to move part of the session-config to web.xml, such as:


The rest of the session-config that you had defined in zk.xml can remain there.

link publish delete flag offensive edit

answered 2012-06-12 15:04:10 +0800

Gostev gravatar image Gostev
15 1

updated 2012-06-12 15:04:36 +0800

That's maybe suitable solution for some developers, but not for me, in my case zk.xml not working at all (

link publish delete flag offensive edit

answered 2013-07-03 07:18:34 +0800

benbai gravatar image benbai
2228 6

It works well for me with simple zul page below in run-jetty-run/Tomcat 6 and eclipse:


    already timeout

What is your testing server? And what is the content of your login.zul? Are there any specific settings in your zk.xml/web.xml?

link publish delete flag offensive edit
Your reply
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




Asked: 2012-06-07 15:36:35 +0800

Seen: 1,046 times

Last updated: Jul 03 '13

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