How would I go about generating a GUID in PHP? I'm just wanting to make a kinda login cookie that uses a GUID. Thnx :).
Printable View
How would I go about generating a GUID in PHP? I'm just wanting to make a kinda login cookie that uses a GUID. Thnx :).
You'll probably want PHP's session handling functions.
http://uk2.php.net/manual/en/ref.session.php
GUID??? - Do you mean a unique ID for each user :confused:
It was Globally Unique ID, but as you asked me on MSN in the end alls sorted with md5(time()) now :D.Quote:
Posted by visualAd
You'll probably want PHP's session handling functions.
http://uk2.php.net/manual/en/ref.session.php
GUID??? - Do you mean a unique ID for each user :confused:
Just wondering is that safe to just use md5(time()) to identify users login session? if two people loged in within the same second that would cause a problem cause it would then cause the same hash code. I guess I'll have to attach either a small random string to the end or maybe the users ID number to the end.
Yeah attach a random number or add the users user ID to the timestamp as they are most probably going to be unique. Then the chance of getting the same hash would be like 1 in a million.
Oops, hadn't thought of doing it before I hashed it, I was thinking of extending the field a few characters but i guess that is better.