{"id":2060,"date":"2019-03-25T12:21:53","date_gmt":"2019-03-25T16:21:53","guid":{"rendered":"https:\/\/www.thatsoftwareguy.com\/blog\/?p=2060"},"modified":"2020-04-05T12:01:53","modified_gmt":"2020-04-05T16:01:53","slug":"oscommerce-sessions-table-huge","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/03\/25\/oscommerce-sessions-table-huge\/","title":{"rendered":"osCommerce sessions table HUGE?"},"content":{"rendered":"\n<p>If your osCommerce sessions table is the largest table in your database and seems to have grown without bounds, don&#8217;t worry &#8211; the fix is simple. <\/p>\n\n\n\n<p>Edit the file <code>includes\/functions\/sessions.php<\/code> and modify the function tep_session_start.  At the top of the function, you want to add <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ini_set('session.gc_probability', 1);\n@ini_set('session.gc_divisor', 2);<\/code><\/pre>\n\n\n\n<p>Once this file has been installed, and once a few visitors have come to your osCommerce store, the table will be smaller.  But wait!  You&#8217;re not done yet.  <\/p>\n\n\n\n<p>Go into PHPMyAdmin and select your store&#8217;s database.  Select the sessions table, and at the bottom of the list of tables, press the &#8220;With selected:&#8221; dropdown and select &#8220;Optimize table&#8221;.   This will take a minute to run, and once it&#8217;s complete, you&#8217;ll see a big reduction in the size of your sessions table. <\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/before.png\" alt=\"How the osCommerce sessions table looked before (1G)\" class=\"wp-image-2061\" width=\"2306\" height=\"72\" srcset=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/before.png 2306w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/before-300x9.png 300w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/before-768x24.png 768w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/before-1024x32.png 1024w\" sizes=\"auto, (max-width: 2306px) 100vw, 2306px\" \/><figcaption>How the table looked before (1G)<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/after.png\" alt=\"How the table looked after (48 Kb)\" class=\"wp-image-2062\" width=\"2310\" height=\"90\" srcset=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/after.png 2310w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/after-300x12.png 300w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/after-768x30.png 768w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2019\/03\/after-1024x40.png 1024w\" sizes=\"auto, (max-width: 2310px) 100vw, 2310px\" \/><figcaption>How the table looked after (48 Kb)<\/figcaption><\/figure>\n\n\n\n<p>Photo credit: image by James Hammond on Unsplash.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your osCommerce sessions table is the largest table in your database and seems to have grown without bounds, don&#8217;t worry &#8211; the fix is simple. Edit the file includes\/functions\/sessions.php and modify the function tep_session_start. At the top of the function, you want to add Once this file has been installed, and once a few &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/03\/25\/oscommerce-sessions-table-huge\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">osCommerce sessions table HUGE?<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":2064,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-2060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oscommerce"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=2060"}],"version-history":[{"count":9,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2060\/revisions"}],"predecessor-version":[{"id":2569,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2060\/revisions\/2569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media\/2064"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=2060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=2060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=2060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}