Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

cscart_stored_sessions Rate Topic   * * * * * 1 votes

 
  • sap
  • Junior Member
  • Members
  • Join Date: 03-Oct 09
  • 113 posts

Posted 01 October 2010 - 02:42 PM #1

I can't claim to fully understand the database schema, but I keep seeing the following session-related table increasing in size regularly, without any decrease ever:

cscart_stored_sessions

what is the exact function of that table and how can I access it to see the entries/delete the entries (since the size keeps increasing all the time)

Thanks
Sap

PS I am running 2.0.14

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 24 November 2010 - 06:56 AM #2

I can't claim to fully understand the database schema, but I keep seeing the following session-related table increasing in size regularly, without any decrease ever:

cscart_stored_sessions

what is the exact function of that table and how can I access it to see the entries/delete the entries (since the size keeps increasing all the time)

Thanks
Sap

PS I am running 2.0.14


I have cleared logs and statistics but "cscart_stored_sessions" is still huge? When making backup it takes ages to backup this table. How to clear it and whats in it?

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 448 posts

Posted 24 November 2010 - 11:12 AM #3

I recently had that problem and went directly to the database and cleared all data in that table with no problem, but keep in mind, clear is one thing, delete it is another ;)

4.3.9  


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 24 November 2010 - 12:39 PM #4

I recently had that problem and went directly to the database and cleared all data in that table with no problem, but keep in mind, clear is one thing, delete it is another ;)


Ok what i figured that this table holds user carts, it would not be good idea to clear it all.

According to config.php

// Sessions storage live time
define('SESSIONS_STORAGE_ALIVE_TIME', 60 * 60 * 24 * 7 * 2); // 2 weeks


Carts should be stored for maximum 2 weeks.

But I have checked user carts and found this

This week 26, this month 236, this year 507, all 590 carts & wishlists



-------

This table contains bots and spiders

 
  • pbannette
  • Senior Member
  • Members
  • Join Date: 09-Aug 07
  • 1036 posts

Posted 24 November 2010 - 12:56 PM #5

It appears that this is a universal problem with session data not clearing. Why does this process have to be manual?
I have another cart with much fewer features than cs-cart. The same problem existed with this cart and at one point the cart did not work after the sessions table got too large. I had my host clear the tables.
Now the cart has a built in monthly maintenance routine. I log in, it says its time for maintenance, I click a button and caches and session tables are cleared automatically. Takes two seconds.
I think there are several processes in cs-cart that have to be performed periodically on a manual basis, some requires ftp access to perform. These maintenance processes should be automated for the normal user.
Bob

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 25 November 2010 - 06:14 AM #6

It appears that this is a universal problem with session data not clearing. Why does this process have to be manual?
I have another cart with much fewer features than cs-cart. The same problem existed with this cart and at one point the cart did not work after the sessions table got too large. I had my host clear the tables.
Now the cart has a built in monthly maintenance routine. I log in, it says its time for maintenance, I click a button and caches and session tables are cleared automatically. Takes two seconds.
I think there are several processes in cs-cart that have to be performed periodically on a manual basis, some requires ftp access to perform. These maintenance processes should be automated for the normal user.
Bob


My "cscart_stored_sessions" table contained all bots, googlebots, crawlers, spiders log ever visited my site, that was approx 160MB log data.

After removing everything site works much faster, DB size decreased 80-90%.

 

Posted 28 November 2010 - 06:30 PM #7

After removing everything site works much faster, DB size decreased 80-90%.


Just to be clear. Do you mean select Empty in phpMyAdmin?

Thanks

John
Take everything you like seriously, except yourselves. - Rudyard Kipling

 

Posted 28 November 2010 - 06:42 PM #8

Just to be clear. Do you mean select Empty in phpMyAdmin?

Thanks

John


TRUNCATE cscart_stored_sessions
Enter this in the 'sql' tab
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 448 posts

Posted 28 November 2010 - 08:02 PM #9

I just usually select that table from the list and hit the "clear" table option

4.3.9  


 

Posted 28 November 2010 - 09:57 PM #10

TRUNCATE cscart_stored_sessions
Enter this in the 'sql' tab


I just usually select that table from the list and hit the "clear" table option


Same thing - My version is a little meatier but they both accomplish the same task
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 29 November 2010 - 06:24 AM #11

Just to be clear. Do you mean select Empty in phpMyAdmin?

Thanks

John


I do not have phpMyAdmin

So what I did was backed up single database table "cscart_stored_sessions" from
admin.php?dispatch=database.manage

edited it with notepad that handles larger file sizes like this http://www.editpadlite.com/

Removed all lines below

............DEFAULT CHARSET=utf8;

Uploaded & restored
admin.php?dispatch=database.manage

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 448 posts

Posted 29 November 2010 - 08:35 AM #12

smart move darius ;)

4.3.9  


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 29 November 2010 - 11:57 AM #13

Just in a week or less this table increased again from 0 to 50MB...

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 448 posts

Posted 29 November 2010 - 12:03 PM #14

Yes, the same thing happend to me, but even worse because in my admin end some smart errors occured, then I went again to the database and repaired the table and now it increases day to day of course, but nothing much, aldo it's a table you should empty from time to time depending on your shop popularity, it's kind of a pain, but it's got to be done.

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3237 posts

Posted 29 November 2010 - 01:10 PM #15

Yes, the same thing happend to me, but even worse because in my admin end some smart errors occured, then I went again to the database and repaired the table and now it increases day to day of course, but nothing much, aldo it's a table you should empty from time to time depending on your shop popularity, it's kind of a pain, but it's got to be done.


But why information about bots & crawlers should be stored at all ?

 
  • E.Qi.Librium
  • Senior Member
  • Members
  • Join Date: 05-Sep 09
  • 448 posts

Posted 29 November 2010 - 01:15 PM #16

It's automatic and that can olny be determined by the core files, as long as they don't change the rules it will always store sessions from everyone including crawlers, the easy way was to create a direct link in admin to clean those tables, like it exists for cleaning stats

 

Posted 04 December 2010 - 06:35 PM #17

Just wanted to say thanks for the clarification. My Internet has been down all week and not able to post before.

Thanks again

John
Take everything you like seriously, except yourselves. - Rudyard Kipling

 
  • Ion_Cannon
  • Senior Member
  • Members
  • Join Date: 28-Oct 09
  • 178 posts

Posted 04 December 2010 - 11:42 PM #18

As you all know you can add a command to the Quick Link menu in the Administrator panel. Here is a php file, just copy this and upload it to your server and then add a command to run the file. Edit the php file to pass your mysql credentials and if you need to clear out your sessions table it makes it a lot easier than logging into phpmyadmin and doing it that way. At least it works for me....

1. Copy the below code and paste it in a notepad document, name the file "truncate-sessions.php" or anything you wish.

2. Edit the mysql login information.

3. Upload it to your server.

4. Add a Quick link in the back office and point it to whatever you named the file and wherever you put it (secure as needed).

That's it.. Hope this helps some of you.

<?php
$host="localhost"; 
$username="your_db_username";
$password="your_password";
$database="database";
$table="cscart_stored_sessions";

$connection = mysql_connect("$host", "$username", "$password") or die ("Unable to Connect to Server");
mysql_select_db("$database") or die ("Unable to Select Database");
$sql = "TRUNCATE TABLE `$table`";
mysql_query($sql);
echo "CS-Cart Sessions Table Cleared!";
mysql_close($connection);
?>

--
Lolita Glasses
Currently Running: CS-Cart 2.2.4

 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 10 November 2013 - 02:52 PM #19

hi all,
I was just experiencing same problem, but wonderingly on almost last version 3.0.1
Beside of _stored_sessions table I habe also full _sessions table and my question is if I can empty also this table or it has some importat informations, like customers live carts...
Also what is the best frequency of truncating these tables...

many thanks