0

SessionCleanup not working

asked 2012-07-05 13:36:44 +0800

RichardL gravatar image RichardL
768 4

I'm having trouble getting the SessionCleanUp to function. In zk.xml I have this:

<listener>
		<description>Initiate the session</description>
		<listener-class>my.package.SessionInitiator</listener-class>
	</listener>
	<listener>
		<description>Cleanup the session</description>
		<listener-class>my.package.SessionCleanup</listener-class>
	</listener>

This is the SessionCleanup class:
public class SessionCleanup implements org.zkoss.zk.ui.util.SessionCleanup {

	@Override
	public void cleanup(Session sn) throws Exception {
		System.out.println("**************************************************Session cleanup********************************************************************");
	}
}

When I clear the history of my browser, my SessionInitiator class functions properly, but my SessionCleanup doesn't. Any ideas why this could be?

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2012-07-05 14:28:55 +0800

RichardL gravatar image RichardL
768 4

Hmm...After waiting some time (I guess for session timeout) the cleanup method was called. But it was called three times....???

link publish delete flag offensive edit

answered 2012-07-06 00:38:56 +0800

RichardL gravatar image RichardL
768 4

Nevermind - my mistake. After thinking about it (I posted too hastily) it obviously wasn't called three times, instead being three separate sessions.

link publish delete flag offensive edit

answered 2012-07-06 07:40:20 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Hi Richard, only my nosiness, what kind of things you will clean up?

best
Stephan

link publish delete flag offensive edit

answered 2012-07-07 12:04:03 +0800

RichardL gravatar image RichardL
768 4

Hi Stephan,
In my case, I'm using an editor with image upload for user articles, and I'm parsing the HTML of the editor content on session cleanup to check if any images that have already been stored (in S3) have been deleted from the HTML (by the user), and if so delete them from storage. I could do this on every save, but I want to keep the processing time down for the user.

link publish delete flag offensive edit

answered 2012-07-07 14:29:36 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Thanks Richard for the information.

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

Follow

RSS

Stats

Asked: 2012-07-05 13:36:44 +0800

Seen: 153 times

Last updated: Jul 07 '12

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