Opencart Sessions Not Closing – TMP Drive/DIR Full!

Posted by Olly 07/11/2011
Posted in:
Posted by: 

We’ve been using Opencart for a number of large online shop’s recently, its much more scalable and has much cleaner code than other shopping cart packages available.

There are a number of things it does so much better than the rest, stuff like different pricing groups, one page checkout etc.

However, there are a few things it doesn’t do too well – one of which was an issue with the TMP directory on the server the sites are on continually getting filled up, to the point where it would stop anything database driven from working.

Now obviously this is a fairly big issue – as most websites nowadays are (or should be) database driven – so we tried various things to see if we could get it to stop filling up, all with no success.

Then our in-house opencart developer Dave noticed some php.ini files within the root, and the /admin folder of all opencart installations, and in these fields was this line;

session.gc_maxlifetime = 12000000;

This number is in seconds, so in hours that would be; 3,334 – which is 138 days!

I’m pretty sure these don’t need to be stored for so long, so if we change that to 3600 – which is exactly one hour – we’re pretty confident that this issue will no longer happen.

3 responses to “Opencart Sessions Not Closing – TMP Drive/DIR Full!”

  1. Olly says:

    If you have a full tmp drive already, and you have SSH access – then try the following command;

    cd /tmp
    find sess_* -type f -delete

    You can tweak the sess_* bit if there are too many to delete in one go, i.e. put sess_0* or sess_1* to only remove a few, keep tweaking it until you can run the main command – and as long as you tweak the php.ini as detailed above you should not have this issue any more 🙂

    • Robmarie says:

      Hi, thank you for this post I’ve tried doing as you’ve suggested, but it’s not wokrnig.The strange thing is that some of the tables update just fine, but others don’t, and I can’t figure out why. Any ideas?Thank you.

      • Olly says:

        Not off the top of my head – however if you want us to take a look we could do at a small cost to you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Service with a difference We're always covering news to do with the industry and sharing our thoughts. If you have any questions or feedback on anything, just let us know. Our news items are based on our expertise which we inject in to every website we make. If you want to collaborate with us on your website, just get in touch and let us know your plans for it.

Talk to one of our experts on
01623 650333

Contact us
Get your free website review

Think your website may need a refresh? Just let us know your website address, your phone number or your email address and we'll get one of our experts to review your website for free!

  • This field is for validation purposes and should be left unchanged.
"We have been working with Dijitul since 2010 and have always found them to be professional and extremely helpful, they have recently refreshed our website to make it more smartphone and tablet friendly. We would have no hesitation in recommending Dijitul."
Meena Patel – Director, Gardner Douglas Sports Cars
"It is difficult to know how good a company is just by their website alone, so this review is to let potential clients know that I found Dijitul to be professional, responsive and good value for money. I recommend Dijitul to anyone looking for programming services."
Mike O’Sullivan – Director, Access2Books Ltd
"The service Dijitul has provided for my company has been exceptional and I would not hesitate to recommend their services for all of your ecommerce needs."
Sharon Wellings – Director, Earth Angel Grave Care