Jump to content

Sessions


user4fun

Recommended Posts

page 1

session_register("myusername");session_register("mypassword"); echo "Session registered under username = ". $_SESSION['myusername'];

The output shows the session variable myusername and it is correctBUT When I do this

session_register("myusername");session_register("mypassword"); header("location:office_manager.php");

and this in office_manager.php

echo "Session registered under username = ". $_SESSION['myusername'];

the seesion variable is empty! How can I fix this problem?

Link to comment
Share on other sites

You need to call session_start() at the very top of every page you use sessions on.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...