werty37 Posted May 29, 2006 Share Posted May 29, 2006 Hi everyone,Recently i saw a package "php5-uuid" in my synaptic manager. I m using ubuntu dapper drake distribution. The Description says:*********************************************************************OSSP uuid module for php5OSSP uuid is an ISO-C and Perl application programming interface (API)and corresponding command line interface (CLI) for the generation ofDCE 1.1 and ISO/IEC 11578:1996 compliant Universally Unique Identifier(UUID). It supports DCE 1.1 variant UUIDs of version 1 (time and nodebased), version 3 (name based) and version 4 (random number based).UUIDs are 128 bit numbers which are intended to have a high likelihoodof uniqueness over space and time and are computationally difficultto guess. They are globally unique identifiers which can be locallygenerated without contacting a global registration authority. UUIDsare intended as unique identifiers for both mass tagging objectswith an extremely short lifetime and to reliably identifying verypersistent objects across a network.This package provides a module for OSSP uuid functions support in PHPscripts.*********************************************************************Does anyone know how to use this in php5 scripts?Sorry for the long text..Thanks in advancewerty Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/ Share on other sites More sharing options...
Ferenc Posted May 29, 2006 Share Posted May 29, 2006 PHPSESSID is a identifier of a current session.[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] The session module cannot guarantee that the information you store in a session is only viewed by the user who created the session. You need to take additional measures to actively protect the integrity of the session, depending on the value associated with it.Assess the importance of the data carried by your sessions and deploy additional protections -- this usually comes at a price, reduced convenience for the user. For example, if you want to protect users from simple social engineering tactics, you need to enable session.use_only_cookies. In that case, cookies must be enabled unconditionally on the user side, or sessions will not work.There are several ways to leak an existing session id to third parties. A leaked session id enables the third party to access all resources which are associated with a specific id. First, URLs carrying session ids. If you link to an external site, the URL including the session id might be stored in the external site's referrer logs. Second, a more active attacker might listen to your network traffic. If it is not encrypted, session ids will flow in plain text over the network. The solution here is to implement SSL on your server and make it mandatory for users. [/quote]If you use it as a 'uuid' is up to you.If you stick it in a DB is also up to you ( the database doesn't care) Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-39964 Share on other sites More sharing options...
werty37 Posted May 29, 2006 Author Share Posted May 29, 2006 [!--quoteo(post=378095:date=May 29 2006, 09:22 PM:name=Ferenc)--][div class=\'quotetop\']QUOTE(Ferenc @ May 29 2006, 09:22 PM) [snapback]378095[/snapback][/div][div class=\'quotemain\'][!--quotec--]PHPSESSID is a identifier of a current session.If you use it as a 'uuid' is up to you.If you stick it in a DB is also up to you ( the database doesn't care)[/quote]I hope the above reply is for the topic "PHPSESSID". But i just want to knowthat the PHPSESSID generated by php is a uuid. does php generate same session id's over time?Thanks for the reply.werty Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-39967 Share on other sites More sharing options...
Ferenc Posted May 29, 2006 Share Posted May 29, 2006 I will assume a session id can be repeated over a period of time, I never looked into them that far.odds are not likely, but possible ( I haven't won the lottery yet either).So yes it could be a uuid, but not a secure one.The session id can also be assigned.So, using [a href=\"http://us2.php.net/uniqid\" target=\"_blank\"]uniqid()[/a] would get session id closer to meeting the uuid requiremnts you posted Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-40056 Share on other sites More sharing options...
werty37 Posted May 30, 2006 Author Share Posted May 30, 2006 You mean this will give a better uuid, right?[code]<?phpsession_start();echo uniqid(session_id()); //echo uniqid(session_id(),true);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-40138 Share on other sites More sharing options...
Ferenc Posted May 30, 2006 Share Posted May 30, 2006 Yes, a harder to guess uuid.But, session id needs to be set before session start...[code]<?php$token = md5(uniqid(rand(), true));;session_id($token);session_start();echo SID;?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-40158 Share on other sites More sharing options...
werty37 Posted May 30, 2006 Author Share Posted May 30, 2006 Thanks a lot Ferenc... Quote Link to comment https://forums.phpfreaks.com/topic/10711-php5-uuid/#findComment-40314 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.