• Resolved Anonymous User 13801395

    (@anonymized-13801395)


    Hi,

    I’m currently working on making my WordPress site as cookie free as possible for GDPR/privacy reasons and noticed that the Custom Sidebars plugin creates a PHP session (PHPSESSID cookie) on every page.

    I traced this back to the wpmu-lib library that is included in and runs with the plugin, but, I just can’t come up with a reason why a sidebar plugin would need a PHP session?

    Is there a way to disable the use of PHP sessions in the Custom Sidebars plugin and if not, what is the reason that it’s being used?

    Thanks,
    Dan

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @theepicsnowwolf

    I hope you’re well today!

    That’s a fair question Dan but I must admit I’m not quite able to answer it right away, not being a developer myself 🙂

    I’ve already asked our developers for consultation on this subject – why it’s used, if it has to be used and/or if it could be changed/eliminated.

    Please keep an eye on this topic and either I or one of my colleagues will update you here with more information soon.

    Best regards,
    Adam

    Thread Starter Anonymous User 13801395

    (@anonymized-13801395)

    Hi Adam,

    Thank you for your quick reply and for forwarding the issue to the developers, I appreciate your help! 🙂

    Hi @theepicsnowwolf

    I checked the code I it looks like sessions are used in two situation and both them have sense:
    – in admin panel for storing admin notices
    – on frontend for debug explain mode – here if is a piece of documentation how it is used:

    
    /**
    	 * Returns true if the "explain mode" is enabled.
    	 * Explain mode will display additional information in the front-end of the
    	 * website on why which sidebar/widget is displayed.
    	 * This is a per-user option (stored in current session)
    	 *
    	 * @since  2.0.9.1
    	 * @return boolean
    	 */
    	public function do_explain() {
    		return $this->debug;
    	}
    

    On the other hand I’ve found you can set

    
    DEFINE( 'WDEV_USE_SESSION', false );
    
    Thread Starter Anonymous User 13801395

    (@anonymized-13801395)

    Hi @palmiak,

    On the other hand I’ve found you can set
    DEFINE( 'WDEV_USE_SESSION', false );

    I found this in another thread as well and tried pasting it into my wp-config file, but it doesn’t seem to be working (as in, the session is still being initiated on page load). The thread I found this in was a few years old, so maybe this only worked with a previous version of the library?

    I checked the code I it looks like sessions are used in two situation and both them have sense:

    Well, to be honest, I think that storing such information like this is not a good way of doing it as it directly contradicts WordPress’ design choices regarding user sessions. It explains why it is used but it’s still not really a justification as to why a sidebar plugin is the only thing that generates a PHP session (and therefore stores cookies) on the page, while several other plugins that use user state information do not.

    At the very least there should be a way to disable it, can someone confirm that setting 'WDEV_USE_SESSION' to false actually works? Maybe I’m doing something wrong, but it doesn’t seem to do anything for me.

    Hello @theepicsnowwolf

    Please try as follows:

    – disable the plugin
    – clear all caches and clear/remove cookies from browser (or instead later try through incognito mode)
    – then add the DEFINE line as discussed above
    – then enable plugin back

    and see again if it helps. According to my tests it’s working then (but if the session was created before and stored it won’t be removed).

    Kind regards
    Adam

    Thread Starter Anonymous User 13801395

    (@anonymized-13801395)

    Hi @wpmudev-support8,

    thanks very much for update! I’ve followed the steps you provided and clearing the entire browser cache (instead of just deleting the site cookies) seems to have fixed the issue. The plugin now no longer generates a session.

    Thank you again for your help!

    Best,
    Dan

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Why does Custom Sidebars use a PHP Session?’ is closed to new replies.