Session Timeouts

We’re currently fixing a set of issues with a shopping cart created through a different developer for a local client. They did a pretty good job but forgot about session timeouts. A lot of developers gloss over this aspect of their ecommerce site and unfortunately customers pay the price. Sessions are what is created to essentially track you when you first log on to a ecommerce site. This isn’t the bad kind of tracking, this is used for things like keeping items in your cart, logging in and account navigation.

W3C defines them as “A PHP session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application.”

By default sessions usually only last 24 minutes (1440 seconds) in PHP websites, or end when the browser is closed. This is fine for many websites and applications, often desired, but not generally a good idea for ecommerce websites. Why? because why would you want to have to put everything back into your shopping cart if you’ve been inactive for 30 minutes. If you close your browser and come back to shop the next day at the same website, you want your items to still be in there, waiting for you, right?

This is a huge potential non-starter for many folks. Even if they use your website once or twice it may promote them to look elsewhere if your website is annoying or making them have to do additional tasks. Luckily session timeouts are easily rectified in a number of ways which usually depend on your server setup. You can set timeouts on-page, in a php.ini file or through server setting if provided by the host. The point is, if you have a shopping cart, make sure your customers aren’t being aggravated by short session timeouts. It’s important.