The World Through the Eyes of John Brennan
Jeff Atwood made an interesting comment on his blog, Coding Horror, about how to take advantage of AJAX to send sort-of heartbeat back to the server to keep the session from expiring. I think this is a great idea. Getting automatically logged out is extremely annoying (unless of course it’s my bank in which case I’m appreciative).
From his post:
As a user, I can say pretty unequivocally that session expiration sucks. Is it really so unreasonable to start doing something in your web browser, walk away for an hour — maybe even for a few hours — then come back and expect things to just work?
As programmers, I think we can do better. It is possible. I am inundated with session timeout messages every day from a variety of sources, but I’ve never once seen a session expiration message from gmail, for example. Here’s what I suggest:
Create a background JavaScript process in the browser that sends regular heartbeats to the server. Regenerate a new cookie with timed expiration, say, every 5 or 10 minutes.
Code. Design. Explore. is the blog of John Brennan, a web developer/designer, entrepreneur, and avid world traveler. I currently live in San Diego, CA, USA.
My first passion is to create. I want to be part of a successful startup that will empower others. I believe in designing for the user and appreciate other web apps that design for usability.
My second passion is to help. My heart lies in philanthropy and helping others that are just as able, but haven't been afforded the same opportunities only because they were born at a different coordinate on this Earth.
This blog will mostly be around building cool things, although I will surely include my travel experiences when I am abroad. Feel free to subscribe to a specific category if that is only what interests you. And please connect with me. I always enjoy meeting new, interesting people!