Is this even a ".php" file? Are you running it locally with an apache installed? Also, just like kyle04 said, if you are trying to get the actual session id, first thing you have to do is start the session. You do this at the beginning of the file: