larynx Posted January 13, 2007 Share Posted January 13, 2007 I Want To Place Every User That Enters My Site Into A SQL Database And Then Extract Stats From That Database So I Need To Be Able To Uniquely Identify Every User. So What Is The Best Way To Uniquely Identify A User In Your Site Using PHP, Is It Through A Session ID, IP Address, Cookie, Or Something Else?Thanks In Advance... Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 13, 2007 Share Posted January 13, 2007 Will You Be Coding In Camel Case As Well?Have them register with a username and password. The other methods are flawed because:Sessions die when the user leaves, or if it times out they may start a new one.IP: IPs can be dynamic, or shared. My husband and I use the same IP at home, but then I use a different one at work, and we change ours regularly.Cookies: Can be blocked, cleared, etc. Quote Link to comment Share on other sites More sharing options...
larynx Posted January 13, 2007 Author Share Posted January 13, 2007 I Have An Itchy Shift Finger...Opening Accounts Isn't An Option For The Person I'm Building The Website For, So What's The Second Best Option? Quote Link to comment Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 The socond best option would be to leave a cookie on the clients pc, but yes, this isn't reliable. Quote Link to comment Share on other sites More sharing options...
larynx Posted January 13, 2007 Author Share Posted January 13, 2007 OK, How Do I Get The Cookie's ID So I Can Place It In A Database? Quote Link to comment Share on other sites More sharing options...
flash gordon Posted January 13, 2007 Share Posted January 13, 2007 $_COOKIE['cookie_name'];I would use a sessionID as the identifier and store that in the cookie to track user. Google and other indexing bots do bot accept cookies, so you might not want to track them. Let me see if I can find you my old script for this..... Quote Link to comment Share on other sites More sharing options...
flash gordon Posted January 13, 2007 Share Posted January 13, 2007 link:http://actionscript.org/forums/showthread.php3?t=92153&page=2http://www.phpfreaks.com/quickcode/Sniff_a_Client_Browser_and_OS/35.php Quote Link to comment 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.