[thelist] PHP - Numeric Session ID's

Rob Smith rob.smith at THERMON.com
Tue Feb 1 14:14:28 CST 2005

When you do (in ASP) response.write session.sessionID, you might get
861722675, which is perfect for assigning integer temporary customer id
int(4). However when you do echo session_id;, you might get
a39423b3243c3342e324db3343f45a23, 32 alphanumeric characters. All of a
sudden this doesn't work so well for the same data type. Your customer id at
this point becomes varchar(32). 

So, temporarily I've done this:
   if ($_SESSION["cid"] == "") {
      $_SESSION["cid"] = rand()%999999999999999;	

Sorry. I'm just used to working with customer is in the numeric form. Is
there really anything wrong with using the alphanumeric version on steroids?

Rob Smith

More information about the thelist mailing list