How do I enable session variables in WAMP5 2.0

Session variables are not working at all in WAMP5, any suggesions?
thanks.
awarraicAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Oddsen84Connect With a Mentor Commented:
I have no problem with it... I just did session_start(); on the second page and I am running WAMP5 Version 1.7.2. Maybe it's your install that's corrupt?
0
 
Oddsen84Commented:
Have you done session_start(); ???
0
 
awarraicAuthor Commented:
Yes I did.
Here are three pages that I have.
Page 1 - login page ---------- login in and sending the lgoin info to page 2
<form action="auth.php" method="gett">
     Please Log In
      <label for="user_name">Username* </label>
        <input type="text" name="user_name" id="user_name" />
        <label for="user_password">Password*</label>
        <input type="password" name="user_password" id="user_password"  />
        <input type="submit" name="submit" id="submit" value="submit"  />
</form>

Page 2 ------------------------------- setting up the session variables
<?php
$input_username = $_GET['user_name'];
$input_password = $_GET['user_password'];

$_SESSION["authenticate"] = $input_username;
$_SESSION["password"] = $input_password;
header("Location:mainAdmin.php");
?>

page 3 ---------------------- printing out passed session values
<?php session_start();
echo "test 1 = ";
echo $_SESSION["authenticate"];
echo $_SESSION["password"];
?>
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Oddsen84Commented:
Oh and by the way you need to make session_start(); one of the first lines of code you write. And I am unsure but I don't think you can echo or print any thing before that line of code...
0
 
john chambersweb designerCommented:
You also have to include session_start(); on page 2 prior to setting the session variables.
0
 
awarraicAuthor Commented:
Yea sorry, have that session_start(); on page 2, just mistypoed in here when I cleaned the code a lil bit.
0
 
awarraicAuthor Commented:
Thanks much.
0
All Courses

From novice to tech pro — start learning today.