Jump to content

$_SESSION variable disappears


obay

Recommended Posts

i have a very weird problem..

 

page1.php:

 

session_start();
$_SESSION[username] = "myname";
header("location:page2.php");

 

page2.php:

 

print_r($_SESSION);
session_start();
print_r($_SESSION);

 

yields:

 

Array( ) Array( )

 

when the second print_r() is supposed to print the session variable.

 

What is wrong? Any help appreciated!!!

Link to comment
https://forums.phpfreaks.com/topic/167109-_session-variable-disappears/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.