cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject [RT] improving the session concept
Date Mon, 07 Apr 2003 21:12:59 GMT
Suppose you have a web application that generates a bunch of temporary
files in order to function properly.

What is the best practice to deal with that temp data?

There are a few alternatives:

 1) leave it there and garbage collect at night with a cron job

 2) store the temp ids in the session and remove them at logout

I personally like the second approach because it's self-contained.

The problem is that I'm pretty sure a lot of people simply won't call
logout, so the session will expire and we'll left with the previous
point (which makes it useless to even try the second).

The really kick-ass thing would be to have a way to push an event
listener into the session, that it gets called when the session expires.

The problem is that the servlet API doesn't include this and there is no
(portable) way to hook cocoon into the *real* session.

At the same time, since we completely virtualize the environment, it
should be entirely possible to provide this feature ourselves.

Imagine a flow like:

 function cleanup() {
   // do cleanup
 }

 cocoon.createSession(cleanup);

wouldn't that kick ass?

-- 
Stefano.



Mime
View raw message