'$ _SESSION' in wpwngine

1

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
source

1 answer

1

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(
    array(
        'item_id'   => 43,
        'item_name' => 'My Product Name'
    ),
    array(
        '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