[Twisted-web] issue with session and LivePage
carl at clingfire.net
Sun Jun 12 11:16:36 MDT 2005
I have a guarded site using livepage. If the user is currently viewing a
livepage site and lets the session expire (i.e they do nothing), livepage
will generate a client side alert that is basically the contents of the
stylesheet in failure.py. Not such a good user experience :)
After some digging I noticed that Livepage doesn't have a notifyOnExpire
handler (liveevil does however). The solution is to add a handler in the
self.handle = handle
The problem is in the implementation of OnExpireCallback. The current code:
# send the user back to the main page
self.handle.sendScript('window.location.href = "/"')
A couple of issues here:
1) it doesn't seem right to call _closeComplete() but it seems to work. Is
there a better solution?
2) I would like to do something a bit fancier here that involves displaying
a DIV for 1 sec and then redirecting to the main page. Sample client side
JS (you could do the same thing by using the client handle).
newval = "<div id='logoutpopup'>" + strval + "</div>";
self.setTimeout("window.location.href = \"/\"",500) }
However, calling handleLogout before calling _closeComplete() will result in
the same error mentioned at the top. Perhaps a timing issue?
Perhaps some of these issues will be resolved with donovan's new livepage,
although I noticed on his branch that there still isn't a notifyOnExpire
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-web