"Session timeout workaround in Seaside" by Mike Filonov on at mikefilonov/sessiontimeout under #seaside   1 thanks

Session timeout workaround in Seaside

You may face a problem with a Seaside application when you have a component which is used for some time without any requests. Like a text-editing form which is used for writing long texts. If it takes a user to write a text for time longer then a session timeout then all his work will dissappear due to an invalid session when the form is submited. Here is a small code that solves this problem by making session prolongate while user's browser is open.

1. Solution

The solution I got is quite simple. I made a small jQuery ajax code that triggers an empty server-side action every 30 seconds. This makes server to prolongate user's session while browser is active and send's this calls.

The code is very simple:

html paragraph script: 
	(html jQuery this load
		html: [ :canvas | canvas render: '' ];
		interval: 30000);
      with: ''	

Just paste in somewhere in your render and it should work.

blog comments powered by Disqus