jeremy5357
New Member
- Messages
- 5
- Reaction score
- 0
- Points
- 0
I am having problems with PHP sessions. If anyone can tell me what I'm doing wrong, it will be greatly appreciated.
I could not get PHP sessions to work so I made a very simple test at http://cookies.x10.mx/sesstest.php.
It creates a session and stores a session variable as $_SESSION['test']. It then redirects the user to http://cookies.x10.mx/sessreceive.php where it will try to read the stored session and display to user.
The code to the pages are listed below.
This is all the code of sesstest.php
This is all the code of sessreceive.php
The output is blank.
Could someone tell me what I'm doing wrong?
I could not get PHP sessions to work so I made a very simple test at http://cookies.x10.mx/sesstest.php.
It creates a session and stores a session variable as $_SESSION['test']. It then redirects the user to http://cookies.x10.mx/sessreceive.php where it will try to read the stored session and display to user.
The code to the pages are listed below.
This is all the code of sesstest.php
PHP:
<?php
session_start();
$_SESSION['test']="TEST SESSION TEXT";
header('location:sessreceive.php');
?>
This is all the code of sessreceive.php
PHP:
<?php
echo $_SESSION['test'];
?>
The output is blank.
Could someone tell me what I'm doing wrong?
Last edited: