WP Rentals Help WP Rentals Help

  • Client Support
  • Video Tutorials
  • WpRentals
  • WpEstate
  • API
Home / Technical how to / Facebook SDK returned an error: Cross-site request forgery validation failed. Required param “state” missing.

Facebook SDK returned an error: Cross-site request forgery validation failed. Required param “state” missing.

10990 views

If you get this error when using Facebook login

Facebook SDK returned an error: Cross-site request forgery validation failed. Required param "state" missing.

Add the following to functions.php in the child theme:

add_action('init', function() {
    session_start();
    if ( isset( $_GET['state'] ) ) {
        $_SESSION['FBRLH_state']=sanitize_text_field($_GET['state']);
    }
});

NOTE: this situation is specific to domain setup (if the domain url can be accessed in different ways (ex: with www, without www, with http and with htpps) facebook considers the url doesn’t pass validation. This code helps only in this situation, that is why it must be added only in case you get this error.

 

Technical how to

Related Articles

  • How to Disable WordPress Image Compression and Preserve Original Quality
  • How to Change the Default Categories Icon from Listing Card Unit
  • How to change the background color and logo for admin login page
  • How to redirect Instant Booking Button to WooComemrce Checkout Page

HELP CATEGORIES

  • 71. General
  • 102. Installation & Basic Setup
  • 393. How Booking Works
  • 20Advanced Search
  • 19Elementor Free & WP Rentals Studio
  • 13Email Notifications
  • 10FAQ
  • 14Installation FAQ
  • 10Menu Options
  • 27Multi-Languages - 3rd party
  • 32Owner & Renter
  • 9Page Templates
  • 24Property / Listing
  • 21Shortcodes
  • 4Supported Maps
  • 97Technical how to
  • 5Third Party plugins
  • 3Translation
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 12WP Rentals Payments
  • 78WP Rentals Theme Options

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WpRentals
  • WpEstate
  • API