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
Place this code in your functions.php file
function sess_start() {
if (!session_id())
session_start();
}
add_action('init','sess_start');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With