[ZPT] zope and mutual exclusion reserved area

Tino Wildenhain tino at wildenhain.de
Thu Jan 13 02:10:37 EST 2005


On Thu, 2005-01-13 at 06:38 +0100, robert wrote:
> mafa77 wrote:
> 
> >Hi!
> >I'm building a site with a particular administration area: I manage
> >login with MySQL and sessions and I want exclusive access to reserved
> >area, to do so I use a flag in db that indicates if an admin is in
> >reserved area. The problem is that if admin close browser without log
> >out, flag doesn't change and admin can't login never in thee future
> >because of "an administrator is in the reserved area". I try to use
> >expiration time of session with negative results. 
> >
> >Only if I use a javascript and window closing can I resolve it?
...
> >
> What exactly are you doing in the session?
> Sessions allow to have a script executed when they are created and 
> destroyed. So maybe you could use these features to have your falag set 
> and removed.

Yes, but only as kind of timeout and a bit luck (depending on the 
session implementation you use).

I think: exclusive access is not so a great idea. Even mySQL has
transactions now, so I bet there is a better way.

Regards
Tino



More information about the ZPT mailing list