1 Jul 2008 09:01
Session server expiration hook
Hi,
I'm currently playing with a project where I have need to close some
resources when a user's session expires. Unless I've missed something, I
haven't found a good way of doing this.
In the end I added some code to the yaws_session_server to provide a
mechanism for allowing application tidy when a session expires, and I've
attached the changes as a proposed patch. It modifies
yaws_session_server to add an optional pid to the session information.
When the session expires, the pid is sent a message of
{yaws_session_end, Reason}, where Reason is either timeout or normal,
depending on whether the session has expired or was deleted explicitly
via the api. Sending a message to a pid seemed like a better idea than
having a callback function as it keeps the session server decoupled from
application code. The yaws_api is also modified to add a new function to
allow the PID to be specified on cookie creation.
Does this change seem like a good idea, or is there another/better way
of doing session cleanup?
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
(Continue reading)
RSS Feed