PHP Developers Network

Custom Session in wordpress
Page 1 of 1

Author:  vishalp [ Tue Jul 05, 2016 4:40 am ]
Post subject:  Custom Session in wordpress

Hello ,
i am trying to set session in theme so i have added code in header.php file of theme folder. when we set session it works but after refresh the page,it destroy. I have changed in load.php file by adding '_session' in wp_unregister_GLOBALS() function. I don't know what it going wrong. :( My code is as follows:

Syntax: [ Download ] [ Hide ]
echo "Session Set ".$_SESSION['usersubdomain'];
echo "Session is not Set ";
$_SESSION['usersubdomain']="Check Session";

each and every time it echos "session is not set";

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group