[SOLVED] Session Problem

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
php_matt_k
Forum Newbie
Posts: 6
Joined: Thu Nov 06, 2003 3:47 pm

[SOLVED] Session Problem

Post by php_matt_k »

I have a problem with my sessions. I dont know what is going on. The sessions are not going from page to page.. i can access the session variable on the first page that i set it on.. but once i move to the second page it isnt there... i also noticed that when i click on a link on the second page.. it appends the sessionid to the post variables... what is going on!? im losing my mind.

This is the first page, basically:

<?
session_start ();
header("Cache-control: private");
?>

blah blah blah
<?
$temp = 1;
$_SESSION['logged_in'] = $temp;
echo $_SESSION['logged_in'];
?>

It echos 1.. as it should...

then when i move to page 2....
i start the session... and try to reference the session var.. and it doesnt work..
Last edited by php_matt_k on Thu Nov 06, 2003 5:59 pm, edited 1 time in total.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Try it without header("Cache-control: private")
php_matt_k
Forum Newbie
Posts: 6
Joined: Thu Nov 06, 2003 3:47 pm

Post by php_matt_k »

i did that already... and i figured somthing else out too.. it works for EVERYONE else but me... i had a few people visit the link and tell me what happened.. and it works fine.. somthing is up with my browser.. i have all the security stuff to low.. so it can do whatever it wants.. and i have the session cookies and cookies all on..
php_matt_k
Forum Newbie
Posts: 6
Joined: Thu Nov 06, 2003 3:47 pm

Post by php_matt_k »

Whew... problem solved FINALLY.. i had a few friends try and go to the link.. to see what'd happen.. and they had NO problems.. so i figured somthing was wrong with my browser.. i made sure that my cookies and session cookies were enabled.. and they were.. no luck still.. so i decided to get SP1 for IE6.. and it works fine now! WOO HOO
Post Reply