|
-
Nov 13th, 2004, 08:08 AM
#1
Thread Starter
Ex-Super Mod'rater
Generating a GUID -[RESOLVED]-
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 .
Last edited by Electroman; Nov 13th, 2004 at 08:21 AM.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Nov 13th, 2004, 08:13 AM
#2
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
-
Nov 13th, 2004, 08:21 AM
#3
Thread Starter
Ex-Super Mod'rater
It was Globally Unique ID, but as you asked me on MSN in the end alls sorted with md5(time()) now .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Nov 17th, 2004, 05:40 PM
#4
Thread Starter
Ex-Super Mod'rater
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.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Nov 17th, 2004, 05:45 PM
#5
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.
-
Nov 17th, 2004, 05:52 PM
#6
Thread Starter
Ex-Super Mod'rater
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.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|