• Resolved xninedesign

    (@x9design)


    I’m experiencing a fatal error with LiteSpeed Cache when submitting a comment. It appears to be related to the setcookie() function and an invalid “path” parameter. Here’s the error message:

    Fatal error: Uncaught ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" in /home/srv77158/domains/bezschematu.pl/public_html/wp-content/plugins/litespeed-cache/src/vary.cls.php:757
    Stack trace:
    #0 /home/srv77158/domains/bezschematu.pl/public_html/wp-content/plugins/litespeed-cache/src/vary.cls.php(757): setcookie('_lscache_vary', 'commenter', 1768432365, '/chrisziyo/4634...', '', true, true)
    #1 /home/srv77158/domains/bezschematu.pl/public_html/wp-content/plugins/litespeed-cache/src/vary.cls.php(605): LiteSpeed\Vary->_cookie('commenter', 1768432365, '/chrisziyo/4634...')
    #2 /home/srv77158/domains/bezschematu.pl/public_html/wp-content/plugins/litespeed-cache/src/vary.cls.php(586): LiteSpeed\Vary->add_commenter(true)
    #3 /home/srv77158/domains/bezschematu.pl/public_html/wp-includes/class-wp-hook.php(326): LiteSpeed\Vary->append_commenter(Object(WP_Comment))
    #4 /home/srv77158/domains/bezschematu.pl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #5 /home/srv77158/domains/bezschematu.pl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #6 /home/srv77158/domains/bezschematu.pl/public_html/wp-comments-post.php(55): do_action('set_comment_coo...', Object(WP_Comment), Object(WP_User), false)
    #7 {main} thrown in /home/srv77158/domains/bezschematu.pl/public_html/wp-content/plugins/litespeed-cache/src/vary.cls.php on line 757

    The error is pointing to this part of the code in vary.cls.php:

    private function _cookie($val = false, $expire = false, $path = false)
    {
    if (!$val) {
    $expire = 1;
    }

    /**
    * Add HTTPS bypass in case clients use both HTTP and HTTPS version of site
    * @since 1.7
    */
    $is_ssl = $this->conf(Base::O_UTIL_NO_HTTPS_VARY) ? false : is_ssl();

    setcookie(self::$_vary_name, $val, $expire, $path ?: COOKIEPATH, COOKIE_DOMAIN, $is_ssl, true);
    }

    It looks like the path parameter passed to setcookie() contains an invalid character. The error occurs when a comment is posted.

    Has anyone encountered this issue before? Is there a recommended fix for this?

    Here is the list of enabled plugins (there is no disabled plugins) – all latest

    Akismet Anti-spam: Spam Protection – 5.3.5
    Converter for Media – 6.2.0
    Edit Author Slug – 1.9.1
    Instant Images – 7.0.1
    LiteSpeed Cache – 6.5.4
    Loco Translate – 2.7.1
    Open Graph and Twitter Card Tags – 3.3.4
    Sucuri Security – Auditing, Malware Scanner and Hardening – 1.9.8
    WP Crontrol – 1.18.0
    WP Mail SMTP – 4.3.0
    WPForms Lite – 1.9.3.2
    WPS Cleaner – 1.6.10.1
    WPS Hide Login – 1.9.17.1
    XML Sitemap Generator for Google – 4.1.21

    Thanks in advance for your help!

    • This topic was modified 1 year, 3 months ago by xninedesign. Reason: Adding enabled plugins list
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal Error in LiteSpeed Cache – setcookie() “path” issue’ is closed to new replies.