$_SESSION problem

I used to name the $_SESSION variable $_SESSION[‘user’]. I was logged in with my webhosting provider. I tried to echo the session variable and my username of my webhosting provider would echo instead of the username of the script i was testing!

So I changed the $_SESSION variable name to $_SESSION[‘id’]. I have a login script that records the user’s id with the session variable $_SESSION[‘id’]

But sometimes, when I try to echo it on a form, it comes out as Array.

So to find out what was going on I checked what was inside that array by doing this:


foreach($_SESSION as $printit)
{
	echo '<li>'.$printit.'</li>';
}

It print two values:
1
Array

It was supposed to print the number 18 instead of the word array.

Any idea of what this problem might be?