Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Paypal_Session Table is Huge

    Zen 1.3.8

    Can this table zen_paypal_session be purged to a certain point? It is over 100MB. Is that typical?

  2. #2
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Paypal_Session Table is Huge

    Hmm...well I've had a look at that table on my own site and been through the ZC code. As far as I can tell stuff goes into that table but is never removed from it. The only exception to this is if you are using PDT in which case the session record is removed when a successful PDT is recorded. Without PDT the session information stays there forever.

    So if you are using straight PayPal IPN (without PDT) the table will just keep growing and growing.

    As far as I can see, once the order has come through into the ZC Admin, the record in the paypal_session table is no longer required. It may be a bug, I'm not sure.

    Maybe DrByte could give his opinion?

    Regards,
    Christian.

  3. #3
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Paypal_Session Table is Huge

    I just found this thread...
    http://www.zen-cart.com/forum/showthread.php?t=103166
    ...where DrByte says that the table can be purged once all the orders have come through.

    The fact that records are never removed from the table looks like a bug to me though. Especially as they have an expiry date on them, you would expect them to be removed after that date.

    Regards,
    Christian.

  4. #4
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Paypal_Session Table is Huge

    To prune the paypal_session table, first take a backup of your Zen Cart database, then go to Tools > Install SQL Patches, paste in the following...
    Code:
    delete from `paypal_session` where expiry < unix_timestamp();
    ...and hit the Send button.

    That will remove any PayPal IPN session records that have expired.

    Regards,
    Christian.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,541
    Plugin Contributions
    127

    Default Re: Paypal_Session Table is Huge

    Make a suggestion that this be added to Tools->Store Manager. There are other things like this such as email cleanup that might also be good candidates for a page like this.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Paypal_Session Table is Huge

    Quote Originally Posted by swguy View Post
    Make a suggestion that this be added to Tools->Store Manager.
    Possibly, but with just one additional line of code the PayPal module can be made to do the clean up automatically in the background without the user ever having to worry about it.

    I can see no logical reason for the paypal session information to stay in the table after the expiry date. I think it just got missed.

    Regards,
    Christian.

  7. #7
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Paypal_Session Table is Huge

    Quote Originally Posted by CJPinder View Post
    I can see no logical reason for the paypal session information to stay in the table after the expiry date.
    I think the data should be kept until a final status has been received form Paypal.

    Maybe Paypal works different, but in general it's possible that a transaction status is "Payed", but not yet received by the shop. Also after the expiry date.

  8. #8
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Paypal_Session Table is Huge

    Quote Originally Posted by paulm View Post
    I think the data should be kept until a final status has been received form Paypal.

    Maybe Paypal works different, but in general it's possible that a transaction status is "Payed", but not yet received by the shop. Also after the expiry date.
    The paypal_session records are used solely with PayPal IPN and only need to be kept until the IPN call-back has occurred and the order has been created. After that the information is never used. The expiry time is set for 2 days after the PayPal transaction starts. If the IPN call-back hasn't happened within 2 days it probably isn't going to and you should have taken action about it before then anyway.

    Regards,
    Christian.

  9. #9
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: Paypal_Session Table is Huge

    Thank you so much, Christian :) Did you make a suggestion for the future? (it would probably sound better coming from you because you obviously know your stuff :) )

    All my orders were processed and complete, I ran the query through navicat and the table is so nice and shiny!!! :)




    Quote Originally Posted by CJPinder View Post
    To prune the paypal_session table, first take a backup of your Zen Cart database, then go to Tools > Install SQL Patches, paste in the following...
    Code:
    delete from `paypal_session` where expiry < unix_timestamp();
    ...and hit the Send button.

    That will remove any PayPal IPN session records that have expired.

    Regards,
    Christian.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Paypal_Session Table is Huge

    The suggestion is noted for future consideration.

    In fact, a Store Manager option for this is already built-in to v2.0.0 development code.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sessions Table HUGE, bringing down site 1.5.1
    By sbbemn in forum General Questions
    Replies: 4
    Last Post: 21 Dec 2025, 01:03 PM
  2. Session Table is huge - 500MB only 4 rows?
    By SarahL in forum General Questions
    Replies: 3
    Last Post: 7 Jun 2011, 06:31 PM
  3. 145 Table 'paypal_session' is marked as crashed and should be repaired
    By freya in forum Managing Customers and Orders
    Replies: 3
    Last Post: 3 Nov 2009, 07:09 PM
  4. PayPal_Session DB Table Issues
    By johnkosh in forum PayPal Website Payments Pro support
    Replies: 5
    Last Post: 11 May 2009, 07:30 PM
  5. 1016 Can't open file: 'paypal_session.MYI' (errno: 145)after upgrading GoDaddy server
    By lyricwings in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 13 Feb 2009, 09:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg