That's the beauty of PHP's sessionids.
Every new visitor will get a unique id. That is, an ID that is not currently in use by anyone else. But someone else may have used it last week.
In order to use sessions, this auto-generated session id MUST be sent from client to server on EVERY request. The easiest way to do that is with cookies.
You can change a setting in php.ini to 'session_use_cookies=1' (forgive memorylapses on the syntax)
Whenever a visitor comes to your site he/she will automatically get a cookie that contains their sessionid.
This id then stays with that client untill he closes the browser or untill PHP expires it (using the session timeout and garbage cleaner)
So the main things are:
1. SessionID is created automatically.
2. Make sure the client allways sends you his sessionid, either through cookies or through the URL (simply print the sessionid in the html code)
3. allways start your page with 'session_start()' (sounds obvious but it's too simple to remember so people forget it a lot)
The sessionID is a long string that you can use as an ID in your database.
Remember, it is a unique string for the CURRENT set of visitors.
After the ID times out, it can be re-used for a new visitor.
It does not always uniquely identify each and every user.
The ID that John gets today may be given to Martha tomorrow, so make sure
that you cleanup old records when the sessionid times out.