[Twisted-Python] notifyFinish not being called on Windows 10 Twisted 16.4.1

Cory Benfield cory at lukasa.co.uk
Mon Oct 17 10:48:20 MDT 2016


> On 17 Oct 2016, at 17:27, John Aherne <johnaherne at rocs.co.uk> wrote:
> 
> OK. Thanks for the link.
> 
> That explains what is going on although I'm not too clear on the details.
> 
> What I was looking to do was set up an http session and when the browser went away use that a the trigger to expire the session.
> 
> I didn't just want to set some arbitrary time frame to expire the session but if they just exited the browser or browser tab I could use notifyFinish to pick up the lost connection and I could then expire the session.
> 
> I have'nt  spotted any other info re sessions that would help with this.

The biggest issue here is that “when the browser goes away” is not a well-defined condition that the server can observe. Browsers will attempt to keep connections open as long as they can, meaning that connection termination may not be observed until quite some time later.

Is there any reason that standard cookies (ones that expire at the end of a browser session) + explicit log out aren’t a suitable approach here?

Cory





More information about the Twisted-Python mailing list