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.

10923 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 change the background color and logo for admin login page
  • How to redirect Instant Booking Button to WooComemrce Checkout Page
  • Tehnical: Redirect to Page Not found/ White screen on listing submission or edit
  • Technical – Invoices from My Bookings

HELP CATEGORIES

  • 61. General
  • 102. Installation & Basic Setup
  • 93. Installation FAQ
  • 404. How Booking Works
  • 145. User dashboard pages
  • 20Advanced Search Options
  • 3Blog Post
  • 9Custom Page Templates
  • 18Elementor Compatibility
  • 13Email Notifications
  • 19FAQ
  • 10Menu Options
  • 26Multi-Languages - 3rd party
  • 9Owner
  • 25Property / Listing
  • 21Shortcodes
  • 11Submit Form
  • 4Supported Maps
  • 93Technical how to
  • 5Third Party plugins
  • 3Translation
  • 13Widgets
  • 2WooCommerce Payments
  • 13WP Rentals Payment
  • 77WP Rentals Theme Options

Join Us On

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