Categories
CMS Mastering Development Wordpress

php session not going to next page in wordpress

I have a WordPress website. As the sessions are not activated by default I did the following code in my function.php: function ur_theme_start_session() { if (!session_id()) session_start(); } add_action("init", "ur_theme_start_session", 1); Now I am getting value from URL and storing it in session like below: $_SESSION[‘accessory’] = $_GET[‘item’]; $accessory=$_SESSION[‘accessory’]; The sessions variable is only echoing […]