I have used session_start() in two templates of my wordpress site. In local server the i can able to use session variable in both the templates.
But in live server i am unable to retrieve the session value. It shows blank array when i use
print_r($_SESSION)
Thank You
WordPress will allow only these Variables:-
wp_unregister_GLOBALS
this function will reset yourSESSION
for some security reason. you can find this function in WordPress Package (File:- wp-includes/load.php
)You can find Documents Here.
So, If you want to use
SESSION
than you need to use plugin for allowSESSION
variable to use.Hope it will help you.
Place this code in your functions.php file