Sessions not working across pages...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yoji
Forum Commoner
Posts: 25
Joined: Sun Oct 19, 2008 3:09 am

Sessions not working across pages...

Post by yoji »

I have tried everything... Lmme show you the code first:
This is page 1:

Code: Select all

 
<?php
session_start();
$_SESSION['name']='dexter';
echo $_SESSION['name'];
?>
<a href="page.php">Go to this page</a>
 
This is page.php:

Code: Select all

 
<?php
session_start();
echo $_SESSION['name'];
?>
 
Session works just fine for that one page.. Where it echoes. But on the second page it gives this error:Undefined variable: _SESSION.
I have tried everything.. I have been through documentation. I have just finished comparing my php.ini sessions part with the online defaults.. I have been through documentation. I have even changed my php version because I though the prob might be a bug or something in my version... Nothing Is Working... Kindly help me out here...
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Sessions not working across pages...

Post by jaoudestudios »

Reposting the same question again and again will not get someone to help you faster.
Post Reply