Log in

View Full Version : PHP Session ID



onestopplay
07-06-2009, 02:12 PM
PHP Sessions... I have tried to follow every tutorial on Google bu none of them give me an explanation on a session ID.
What's a session Id, how do I use it??
I don't currently use session ID's and my login still works. But does this add more security?
I have this code:

<?
session_start();
if(!session_is_registered(username)){
header("location:login.php");
}
?>

Do I need to make this more secure using session id's??

traq
07-06-2009, 08:07 PM
if you're using sessions, you've got a session id. the session id is generated by the server to keep track of the session; you don't assign it.

onestopplay
07-06-2009, 11:49 PM
Thanks. On a website I have seen:
page.php?PHPSESSIONID=idcode
when is this nessacary?

traq
07-07-2009, 12:22 AM
...I'm not sure. It may be trying to do something else. Can you post a link to the tutorial you're trying to follow?

onestopplay
07-07-2009, 12:31 AM
It's not a tutorial. On this website it says page.php?PHPSESSID=sessionidhere
so this isn't important?

traq
07-07-2009, 05:09 AM
It's not a tutorial.
I'm sorry, your first post makes it sound like you're looking at tutorials.

On this website it says page.php?PHPSESSID=sessionidhere
so this isn't important?
What website are you looking at? Please post a link.

On its own, that line is completely meaningless. Something else on the page or server has to make use of it. Is it in the address bar (it looks like some info being passed between pages via GET, which isn't a "session" at all)?