Login Security plugin conflict
-
Hi. I’m getting notifications of fatal errors (although the site doesn’t appear broken when I visit it) after I log in. From the error details, it seems like it might involve a conflict with WooCommerce and our login security plugin. That plugin automatically logs a user out after they have been idle for too long. If I’m reading the error details correctly, the problem involves the way that WooCommerce “destroys” the session cookie.
But maybe that’s not it at all, and it is a problem with wc_empty_cart()?
Here are the error details:
Error Details ============= An error of type E_ERROR was caused in line 372 of the file [path-to-installation]/wp-content/plugins/woocommerce/includes/class-wc-session-handler.php. Error message: Uncaught Error: Call to undefined function wc_empty_cart() in [path-to-installation]/wp-content/plugins/woocommerce/includes/class-wc-session-handler.php:372 Stack trace: #0 [path-to-installation]/wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(363): WC_Session_Handler->forget_session() #1 [path-to-installation]/wp-includes/class-wp-hook.php(308): WC_Session_Handler->destroy_session(2) #2 [path-to-installation]/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #3 [path-to-installation]/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 [path-to-installation]/wp-includes/pluggable.php(665): do_action('wp_logout', 2) #5 [path-to-installation]/wp-content/plugins/login-security-solution/login-security-solution.php(2618): wp
And, if this helps any, here is the referenced line from the login security plugin (line 2618 is the final line quoted here) and the lines leading up to it pertaining to session cookies:
/**
* Sends HTTP Location headers that direct users to the login page
*
* Also permits adding message ID’s to the URI query string that get
* interpreted by our login_message() method, which displays them above
* the login form.
*
* Utilizes WordPress’ “redirect_to” functionality to bring users back to
* where they came from once they have logged in.
*
* @param string $login_msg_id the ID representing the message to
* display above the login form
* @param bool $use_rt use WP’s “redirect_to” on successful login?
* @param string $action “login” (default), “rp”, or “retrievepassword”
* @return void
*
* @uses login_security_solution::$key_login_msg to know which $_GET
* parameter to put the message id into
* @see login_security_solution::login_message() for rendering the
* messages
* @uses wp_login_url() to know where the login form is
* @uses wp_logout() to deactivate the current session
* @uses wp_redirect() to perform the actual redirect
*/
protected function redirect_to_login($login_msg_id = ”, $use_rt = false,
$action = ‘login’)
{
if ($use_rt && !empty($_SERVER[‘REQUEST_URI’])) {
$uri = wp_login_url($_SERVER[‘REQUEST_URI’]);
} else {
$uri = wp_login_url();
}
$uri = $this->sanitize_whitespace($uri);if (strpos($uri, ‘?’) === false) {
$uri .= ‘?’;
} else {
$uri .= ‘&’;
}
$uri .= ‘action=’ . urlencode($action);if ($action == ‘rp’) {
if (empty($_COOKIE[‘wp-resetpass-‘ . COOKIEHASH])) {
// Cookie not set. Site on WP < 3.9.2. Do it the old way.
$uri .= ‘&key=’ . urlencode(@$_GET[‘key’]);
$uri .= ‘&login=’ . urlencode(@$_GET[‘login’]);
}
}if ($login_msg_id) {
$uri .= ‘&’ . urlencode($this->key_login_msg) . ‘=’
. urlencode($login_msg_id);
}wp_logout();
Any idea what’s going wrong hre? Any other info I can provide to help with this?
- The topic ‘Login Security plugin conflict’ is closed to new replies.