Home > DeveloperSection > Forums > How to use custom Session Value
Goti Bandu

Total Post:119

Points:835
Posted on    October-31-2014 11:54 PM

 ASP.Net Session  Session Management 
Ratings:


 1 Reply(s)
 546  View(s)
Rate this:
How can i use my own (custom) session value inside wordpress?
For example: $_SESSION['myname']="mindstick"

I've already inserted session_start() at all page i need as following.

<?php
session_start();
$_SESSION['myname'] = "mindstick";
?>

But not working.
Just working on the self page.
It is NOT call-able from another pages (using same logic).


Ashish Pandey

Total Post:128

Points:898
Posted on    October-31-2014 11:54 PM

You need to add following lines at the top of config.php

if (!session_id()) {
    session_start();
}

Then add following line at the top of header.php

session_start();

Modified On Oct-31-2014 11:55:37 PM

Don't want to miss updates? Please click the below button!

Follow MindStick