cscart_stored_sessions

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

[quote name=‘sap’]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[/QUOTE]



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?

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 :wink:

[quote name=‘E.Qi.Librium’]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 ;)[/QUOTE]



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



According to config.php


[QUOTE]// Sessions storage live time

define(‘SESSIONS_STORAGE_ALIVE_TIME’, 60 * 60 * 24 * 7 * 2); // 2 weeks[/QUOTE]



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

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

[quote name=‘pbannette’]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[/QUOTE]



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%.

[quote name=‘Darius’]After removing everything site works much faster, DB size decreased 80-90%.[/QUOTE]



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



Thanks



John

[quote name=‘utilityempire’]Just to be clear. Do you mean select Empty in phpMyAdmin?



Thanks



John[/quote]


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

[quote name=‘JesseLeeStringer’]TRUNCATE cscart_stored_sessionsEnter this in the ‘sql’ tab[/quote]


[quote name=‘E.Qi.Librium’]I just usually select that table from the list and hit the “clear” table option[/quote]



Same thing - My version is a little meatier but they both accomplish the same task

[quote name=‘utilityempire’]Just to be clear. Do you mean select Empty in phpMyAdmin?



Thanks



John[/QUOTE]



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 [url]http://www.editpadlite.com/[/url]



Removed all lines below



…DEFAULT CHARSET=utf8;



Uploaded & restored

admin.php?dispatch=database.manage

smart move darius :wink:

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

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.

[quote name=‘E.Qi.Librium’]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.[/QUOTE]



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

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

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



Thanks again



John

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);
?>

```

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