Monday, January 31, 2011

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

On Monday 31 January 2011 18:38:20 Tim Sawyer wrote:
> > You can't stop the user from closing the browser, or switching to another
> > tab, with JS. And you shouldn't try to stop them navigating away - this
> > sort of thing is only likely to annoy them intensely.
>
> Taking this to the extreme - what do you want to happen if a person using
> your site has a powercut? Or pulls out their network connection? This
> will not run any site-close javascript.
>
> We had a designer request similar functionality in a Struts app years ago
> - it's really annoying and goes wrong often and we vowed never to do it
> again.
>
> How about looking at RabbitMQ or XMPP for presence?
>
> Tim.

This is known as hartbeat pattern. Sending small message from a client to a
server stating "i'm alive".

That way you can have rather small window (still it's a window, not exact
time) to determine is someone logged in or not. Note that you still need
something to determine if heartbeats stopped to come in. So it's you need
additional tests is time between two heartbeats too much, and then do forced
logout.

Now you can have feature that can tell "active users within last X minutes"
quite easily.

--

Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate