CFML debugging: cfdump shown to specific site visitor

Here's a quick little snippet to show CFDUMP content only to your IP, without interrupting the flow of traffic for anyone else who may be using the same site:



<cfif cgi.REMOTE_ADDR is 'My.IP.Address.Here'>
<cfdump var="#form#">
<cfabort>
</cfif>

If you aren't sure of your outward-facing IP address, visit www.whatismyip.com

In this example we are dumping out the #form# scope, but you can dump out whatever you like (by changing the "var" attribute of the cfdump tag) or put any code at all inside the and it will only be executed for views from your specific location.

I wouldn't leave this in a live site but for a quick view of what's going on, without interrupting the experience of others, I find it quite useful.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
I have a chunk of code on our error handling page that will dump form, var, url vars etc. if the visitor is coming from our static IP.
# Author OlPeculier | 6/22/12 11:33 AM
blogcfc 5.9.1.002 by raymond camden
contact michael evangelista