WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WordPress Simple Paypal Shopping Cart] Breaks other plugins with sessions - I have the fix (4 posts)

  1. Mike Challis
    Member
    Posted 3 years ago #

    WordPress Simple Paypal Shopping Cart has a bug that breaks other plugins with PHP $_SESSION

    Problem confirmed with "Fast and Secure Contact Form" (where I am the author of)
    http://wordpress.org/extend/plugins/si-contact-form/

    I have the fix:
    edit wp_shopping_cart.php
    remove:
    session_start();

    Find:

    function widget_wp_paypal_shopping_cart_init()
    {

    Replace with:

    function widget_wp_paypal_shopping_cart_init()
    {
      if( !isset( $_SESSION ) ) { // play nice with other plugins
        session_start();
      }

    Now it will play nice with other plugins with sessions.
    Any plugin that uses sessions should always check if a session was already started before starting one.

    Mike

    http://wordpress.org/extend/plugins/wordpress-simple-paypal-shopping-cart/

  2. mra13
    Member
    Posted 3 years ago #

    The above change will break the functionality. If you want to do this change then do the following:

    search for the following line:

    session_start();

    and replace it with the following:

    if(!isset($_SESSION))
    {
    session_start();
    }

  3. Mike Challis
    Member
    Posted 3 years ago #

    Has the developer fixed this yet?

    Mike

  4. mra13
    Member
    Posted 3 years ago #

    Yep.

Topic Closed

This topic has been closed to new replies.

About this Topic