WP Session not avaible in AJAX functon on WP Engine hosting

100
November 23, 2018, at 2:30 PM

I created a custom Wordpress plugin and it has a Ajax function in which I get data from the woocommerce session:

WC()->session;

Locally works perfect and I get the data from the session.

I am using WP Engine and installed the plugin on the live site and the session data in the ajax function is not available:

add_action( 'wp_ajax_test','test' );
add_action( 'wp_ajax_nopriv_test', 'test' );
function test() {
  var_dump( WC()->session );
}

But if I var_dump( WC()->session ) outside the ajax function everything is fine. So with their support we disabled the whole cache for testing but the problem stays the same.

Does anyone have any idea what might cause this strange behaviour on WP Engine server?

READ ALSO
How to see what source is call my website page PHP

How to see what source is call my website page PHP

I want to know if Its possible to see what resource is calling my website page (PHP file)I have created an API PHP page which handles JSON POST data and saves it to the DB

108
How to make binary tree from array recursively in PHP?

How to make binary tree from array recursively in PHP?

How to make a binary tree from array recursively?I have this code, but I can't figure how to build it?

97
Laravel 5 product order relation syntax: Not unique table/alias

Laravel 5 product order relation syntax: Not unique table/alias

I'm working on an applications which can be used to make pricelist orders for productsIn short: a restaurant has a pricelist, which they can update by following a flow where they can insert new prices

267
Not getting proper mail() attachment. Please correct my code [on hold]

Not getting proper mail() attachment. Please correct my code [on hold]

I got mail with attachment but not in proper file

75