'$ _SESSION' in wpwngine


Good afternoon everyone, I have a project in Wordpress where variables session of PHP are used, the migration is being made to the server wpengine , but said server does not allow sessions PHP , I tried to use setcookie() , but it does not work either, I do not know what else I can do to solve this problem and be able to go to production, this < em> server uses cache in a monstrous way, someone has already had this problem and has been able to solve it.

asked by David Eduardo Gómez Bonilla 03.05.2018 в 19:55

1 answer


It is assumed that wp_session can be used in a very similar way to how $_SESSION is normally used. An example would be something like

global $wp_session;

$wp_session['cart_items'] = array(
        'item_id'   => 43,
        'item_name' => 'My Product Name'
        'item_id'   => 22,
        'item_name' => 'My Second Product Name'

I think this WordPress plugin can help you (and it's free, too).

External reference here (as of May 3, 2018)

answered by 03.05.2018 в 20:05