Wordpress $_SESSION not working even after adding add_action('init, '...',1)
session, wordpress
Solution
Place this code in your functions.php file
function sess_start() {
if (!session_id())
session_start();
}
add_action('init','sess_start');
Problem
I'm trying to make SESSION works with Wordpress but it can't work even I added the below code to my plugin but nothing happen: ``` add_action('init', 'simpleSessionStart', 1); add_action('wp_logout', 'simpleSessionDestroy'); add_action('wp_login', 'simpleSessionDestroy'); function simpleSessionStart() { if(!session_id())session_start(); } function simpleSessionDestroy() { session_destroy (); } ``` How can I make $_SESSION passing date from one page to another in my wordpress site My wordpress version is: 3.5.2 My theme is: twentyeleven