Title: Cookie Issue in Subfolder Setup
Last modified: February 10, 2018

---

# Cookie Issue in Subfolder Setup

 *  [Dinesh Kesharwani](https://wordpress.org/support/users/cyberwani/)
 * (@cyberwani)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/cookie-issue-in-subfolder-setup/)
 * Hi,
 * I am using this plugin on my development server, where some development sites
   are running in sub-folder with the main setup on the root of hosting. And, I 
   am using plugins from a single location on the root of hosting for all sites 
   in sub-folder.
 * I am facing issue with the cookie when trying to access compare list in main 
   setup and sub-folder setups.
 * So, in “__construct” function, I made a small change in code. The code is as 
   below.
    OLD:
 *     ```
       // set coookiename
       if ( is_multisite() ){
           $this->cookie_name .= '_' . get_current_blog_id();
       }
       ```
   
 * NEW:
 *     ```
       // set coookiename
       if ( is_multisite() ){
           $this->cookie_name .= '_' . get_current_blog_id();
       }else{
           if( COOKIEPATH != '/' ){
               $this->cookie_name .= '_' . sanitize_title(COOKIEPATH);
           }
       }
       ```
   
 * Hope, you will get the issue I am facing, and the fix will be added in next version.
 * Thanks
    -  This topic was modified 8 years, 4 months ago by [Dinesh Kesharwani](https://wordpress.org/support/users/cyberwani/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/cookie-issue-in-subfolder-setup/#post-10112424)
 * Hi,
    thanks for this suggestion. I will ask to plugin developer to check this
   and fix it on next plugin release.

Viewing 1 replies (of 1 total)

The topic ‘Cookie Issue in Subfolder Setup’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-compare/assets/icon.svg?rev=3042935)
 * [YITH WooCommerce Compare](https://wordpress.org/plugins/yith-woocommerce-compare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-compare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-compare/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-compare/reviews/)

## Tags

 * [cookie](https://wordpress.org/support/topic-tag/cookie/)

 * 1 reply
 * 2 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/cookie-issue-in-subfolder-setup/#post-10112424)
 * Status: not resolved