Adrian World Design
  • Services
    • Website Consulting
    • Startup Consulting
    • Zend Development
  • Portfolio
    • My Framework
  • Knowledge
    • Web Standards
    • PHP bare-bones
    • Zend Framework
    • Zend Framework 2
    • Git - Github
    • Search Engine Optimization
    • Web Hosting
    • Linux
    • Microsoft Windows
    • Web Browsers
    • Mobile Devices
  • About
    • Business
    • Professionally
    • Personally
  • Contact
    • Contact Form
    • Phone
    • Email
    • Messaging

Knowledge Base Overview

Unique ID per request

Knowledge ⇒ Web Hosting ⇒ Apache Web Server ⇒ Unique ID per request
Tweet
Share on Tumblr

Created: Feb 19, 2012, 9:36:41 AM CSTLast updated: Mar 5, 2012, 2:07:55 PM CST

If you need a unique request ID for each webpage and you run an Apache web server you are all set. There is no need to generate or create a unique request id yourself in PHP, ASP, Ruby or whatever.

mod_unique_id

Apache has a module labeled mod_unique_id that provides a unique request id for each webpage access from your website. If the module is loaded (active) you can find the unique ID in your server and execution environment information. In PHP this would be the global $_SERVER array as follows

$_SERVER['UNIQUE_ID']

Not sure about other languages but I guess you will know where to look for it.

If you already know and have the UNIQUE_ID on one system but it is empty and not available on another system then it is not loaded (commented out) in your httpd.conf file. The module is usually not loaded by default.

Note in the documentation that is says This feature isn't supported on Windows NT. I have an XAMPP server on Windows XP and it available so I guess they refer to the good ol' NT 4.0 times. If you have Apache on Windows just give it a try if you don't have it yet. Again it is usually not loaded by default.

Language and framework independent

Because this is coming from your Apache web server there is no need to generate a unique ID with uniqid in PHP. There is also no need to handle or find it in Zend, WordPress, Joomla, Drupal, Cake or any other framework.

The same is true, of course, for other web languages like Perl, ASP, Ruby or whatever language you are using.

blog comments powered by Disqus
Prev
Next

Powered by FeedBurner Load our "Knowledge Base" feed in your RSS feeder

Follow us on Twitter
Follow us on Facebook
Follow us on LinkedIn
Follow us on Google+

All rights reserved, Adrian World Design ©2009–2021 Powered by Wejas Framework

Jump to Top