# Timeout

andij62
303 1 7

Hello all,

i have a problem with timeout. I set a timer (20 sec) to read data from db to show it in a grid. It works fine but after 30min the session timed out while no user-action (but timer-action!) is available. What can i do that the session is available after the user close the window?

best regards
Andi

delete retag edit

## 3 Replies

SimonPai
1696 1

Hi Andi,

Since HTTP protocol does not force browser to send signal upon closing browser windows, there's no way (on the server side) to tell if a user just closes his browser and leaves.
This is, unfortunately, a restriction on every kind of web app development.

ZK components will simply stay alive until the session is timed out.
Is this what you want to ask?

Regards,
Simon

andij62
303 1 7

Hi Simon,

thanks for your answer. Why the session is timed out although the timer read every 20 sec new Data from DB?

Regards
Andi

SimonPai
1696 1

Hi Andi,

Now I see your concern. By default, ZK does not let Timer event intervene timeout mechanism. However, you can keep session alive by configuring your zk.xml.

<session-config>
<timer-keep-alive>true</timer-keep-alive>
</session-config>


See this reference. It's at the bottom of the page, the "The timer-keep-alive Element" section.

Regards,
Simon

[hide preview]