Home » Php » wordpress – How can i get session value dynamic another url in same page header.php?

wordpress – How can i get session value dynamic another url in same page header.php?

Posted by: admin February 25, 2020 Leave a comment

Questions:

I want to communicate with the session on two pages that I dynamically create on a WordPress theme. I do this on a common header.php file, but I can’t get the session value I sent from one page on the other. Could you help?

$pageName = $_SERVER['REQUEST_URI'];

if($pageName == "/test/"){

    $_SESSION["1cKullaniciLogin"] = "TEST DENEME";

    header("Location: /faaliyet-raporlarimiz/");
    exit();
}

if($pageName == "/faaliyet-raporlarimiz/"){

    if(ISSET($_SESSION["1cKullaniciLogin"]))
    {

    }
    else
    {
        header("Location: /test/");
    }
}
How to&Answers: