Im having trouble with sessions, or, no.. i dont.. its the way i try to load the second page, it seems that the javascript i use to load the second page destroys the session or atleast its variables. Its probably acts as ive open a complete new window.. and ofcourse theres no session then.. now how do i solve this?
I cant use "header", because of how my "real" project is coded, and i dont wanna use cookies... i want a session friendly solution.
Ive made 2 test pages to help illustrate what my problem is.
first page:
Code: Select all
<?php
session_start();
$un = "anders";
$_SESSION['uname']=$un;
$_SESSION['ualias']='olle';
echo("<script language=JavaScript>");
echo("self.location.replace('http://cyberhawk/cyberhawk/testx2.php')");
echo("</script>");
?>Code: Select all
<?php
session_start();
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
echo $_SESSION['uname'];
echo $_SESSION['ualias'];
?>Hope you wizzards can help me out.