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 said on

    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 said on

      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 said on

        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

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.
"Thank you for your work on the Aqua Motion website. We’re all really happy with it, the quality of the work you have produced is top notch and how quickly you responded to my requests was excellent."
Alex Thornton – Business Development Manager, Aquamotion
"The design, development and marketing work Dijitul do for us is invaluable"
Rosie Lees – Managing Director, Milner Off Road
"The team as a whole are very easy to work with, bringing with them good communication, excellent technical problem solving capabilities and a general can-do attitude."
Kish De Silva – Ecommerce Manager, Morley Menswear

Mistakes to Avoid in Digital Marketing

23/01/2015 read more

Latest Marketing Post

Web Design and Website Photography – Why good photos matter

18/02/2015 read more

Latest Web Design Post

Upcoming EU VAT Changes To Effect Digital Industry

25/11/2014 read more

Latest Ecommerce Post

We make awesomefunctionalsuccessfulbeautiful cleanprofessionalsmalllargewordpressecommercemoderneye catching websites

enquire today