Reputation: 159
I am just trying the session_id
function in PHP and I thought that it was unique for each machine that used the website? However, my flatmate and I have the same session_id
for on two separate machines. I'm just using session_id()
to create the session - am I doing it correctly?
Upvotes: 2
Views: 394
Reputation: 449415
You are missing the ()
in your session_id call.
Also remember that you need to call session_id()
before session_start()
if you want to use it to set a specific session ID. From the Manual:
If id is specified, it will replace the current session id. session_id() needs to be called before session_start() for that purpose. Depending on the session handler, not all characters are allowed within the session id. For example, the file session handler only allows characters in the range a-z A-Z 0-9 , (comma) and - (minus)!
Upvotes: 1