How to Enable Sessions in WordPress
The Issue
Let’s say you want to use something like this in your theme or plugin:
$_SESSION['my_var'] = "Hello World!";
It might be actually not working.
The Solution
Paste de following line in your functions.php file of your theme:
if ( !session_id() )
add_action( 'init', 'session_start' );
add_action( 'init', 'session_start' );
Related PostsIf you liked How to Enable Sessions in WordPress; the posts below might interest you too:
|



