<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Thinking Lemur &#187; ColdFusion</title>
	<atom:link href="http://thinkinglemur.com/index.php/category/thinking/programming/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkinglemur.com</link>
	<description>from the mind of Donnie Bachan</description>
	<lastBuildDate>Sun, 11 Jul 2010 01:36:05 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE 7/8 PNG-24 transparency issue</title>
		<link>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/</link>
		<comments>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 11:12:47 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=384</guid>
		<description><![CDATA[We came across an error today without drop down menu system that uses a PNG-24 semi transparent drop shadow image around the border where the transparency would appear black in IE 7 and IE 8. After searching and trying all possible fixes we found the solution to the problem and it was quite simple.
Our menu [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F06%2Fie-78-png-24-transparency-issue%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F06%2Fie-78-png-24-transparency-issue%2F" height="61" width="51" /></a></div><p>We came across an error today without drop down menu system that uses a PNG-24 semi transparent drop shadow image around the border where the transparency would appear black in IE 7 and IE 8. After searching and trying all possible fixes we found the solution to the problem and it was quite simple.</p>
<p>Our menu system uses jQuery (doesn&#8217;t everything these days?), and had a nice fade in and fade out transition. jQuery handles the fade transitions by setting the opacity which IE does not like very much. So using the fadeTo() functions in jQuery is a no-no in IE. The solution, use hide() and show() instead. It&#8217;s not as elegant but the transparency issue was fixed on all modern browsers.</p>
<p>Other solutions to the problem include:</p>
<p>1. Using a background colour instead of transparent on the style so you would do:</p>
<blockquote><p>.my-transparent-stuff{background: #fff url(&#8216;image.png&#8217;) repeat-y scroll left top;}</p>
<p>instead of</p>
<p>.my-transparent-stuff{background: transparent url(&#8216;image.png&#8217;) repeat-y scroll left top;}</p></blockquote>
<p>2. Using PNG-8/transparent gifs (hey, it&#8217;s a solution)</p>
<p>3. Forcing IE8 into IE7 mode by adding the following meta tag:</p>
<blockquote><p>&lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=7&#8243; /&gt;</p></blockquote>
<p>I still can&#8217;t understand what Microsoft is doing!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory leaks with Coldfusion 8</title>
		<link>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 14:58:44 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[ColdFusion 8]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[memory leaks]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=368</guid>
		<description><![CDATA[For the past few weeks I&#8217;ve been incognito due to some memory leak issues we&#8217;ve been having with our new app. It is essentially a rewrite of our existing web application using Object Oriented techniques and embraces the Model-View-Controller paradigm. It really is a pretty little thing but unfortunately she crumbled under the weight of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F02%2Fmemory-leaks-with-coldfusion-8%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F02%2Fmemory-leaks-with-coldfusion-8%2F" height="61" width="51" /></a></div><p>For the past few weeks I&#8217;ve been incognito due to some memory leak issues we&#8217;ve been having with our new app. It is essentially a rewrite of our existing web application using Object Oriented techniques and embraces the Model-View-Controller paradigm. It really is a pretty little thing but unfortunately she crumbled under the weight of the world wide web. Anyone who has faced the memory leak problem will know that it is not an easy one to crack and it takes time to determine the exact issue. There are a lot of articles around that have excellent information which were all very helpful in my quest for a solution.</p>
<p>The system made a lot of use of the session and application scope for caching objects which was the first issue that we had to overcome. It seemed like a good idea, you&#8217;ve got loads of memory, you have a finite amount of objects that can be called for each session why not persist them. The problem is that ColdFusion 8 seems to have an issue with complex objects (i.e. CFCs) stored in the session and application scopes. The reason I say this is that we were seeing a very, very strange thing happening to the memory on our server. When load testing was run, the server was fine, the memory steadily increased until the initial sessions began expiring and then the average of memory usage plateaued, which is what you like to see. However, once the load test ended the memory steadily increased until it crashed the CF instance. Weird right? And so the search for a solution began. I came across a few helpful articles:</p>
<p><a href="http://www.ghidinelli.com/2009/07/16/finding-memory-leaks-coldfusion-jvm">http://www.ghidinelli.com/2009/07/16/finding-memory-leaks-coldfusion-jvm</a></p>
<p><a href="http://www.schierberl.com/cfblog/index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler">http://www.schierberl.com/cfblog/index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler</a></p>
<p><a href="http://www.alagad.com/blog/post.cfm/troubleshooting-coldfusion-performance-analysis-part-ii">http://www.alagad.com/blog/post.cfm/troubleshooting-coldfusion-performance-analysis-part-ii</a></p>
<p>These were tremendously helpful in assisting me in finding the solution. The last post from Alagad was the one that helped cure my issue in the end. You need to ensure that when making copies of persistent scoped variables that they are deep copied or used in a local scope within CFC functions. However, bear in mind that there are many causes for memory leaks and you should spend the time in figuring out the exact cause of your problem. I found the <a href="http://www.eclipse.org/mat/" target="_blank">MAT</a> tool supremely useful.</p>
<p>Here are some tips for curing memory issues:</p>
<ol>
<li>Install cumulative hotfix 4 for ColdFusion 8.0.1 (Get it <a href="http://kb2.adobe.com/cps/529/cpsid_52915.html" target="_blank">here</a>)</li>
<li>Update the JVM to the latest provided by Sun, in my case it was JDK 1.6.0_18 (Get it <a href="http://java.sun.com/javase/downloads/index.jsp" target="_self">here</a>)</li>
<li>Add the -XX:+<em>AggressiveHeap</em> option to the JVM configuration (Read about it <a href="http://www.petefreitag.com/item/139.cfm" target="_blank">here</a>)</li>
<li>Set your min and max heap to the same size to reduce the number of garbage collection calls</li>
<li>Run varscoper against your code and ensure all local variables are var scoped (Get it <a href="http://varscoper.riaforge.org/" target="_blank">here</a>)</li>
<li>Limit the use of variables scope within objects, use the THIS reference instead</li>
<li>Limit the number of complex objects (cfcs) being stored in SESSION and APPLICATION scopes</li>
<li>Clear the variables scope onRequestEnd (this doesn&#8217;t really work when using Application.cfc though)</li>
<li>Run load tests! We used WCAT for Windows (Get it <a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;i=1466&amp;g=6" target="_blank">here</a>)</li>
<li>Turn off CF monitoring use FusionReactor (or something similar) (Get FusionReactor <a href="http://www.fusion-reactor.com/" target="_blank">here</a>)</li>
</ol>
<p>Hopefully these will help someone else going forward.</p>
<p>UPDATE 16/05/2010: Point #6 should be, ensure you scope your variables correctly. The THIS scope has its own set of limitations. Ensure that all variables (including loop indices) have the proper scope to avoid leakage.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON format and serializing ColdFusion query objects</title>
		<link>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/</link>
		<comments>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 20:25:52 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=343</guid>
		<description><![CDATA[Every so often there is a tiny problem that has you scratching your head until you RTFM. I love JSON, it&#8217;s totally awesome and the fact that you can not convert CF objects natively is even better! I ran into a small issue where I was using serializeJSON on a structure that contained a query [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F01%2Fjson-serialize-coldfusion-quer%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F01%2Fjson-serialize-coldfusion-quer%2F" height="61" width="51" /></a></div><p>Every so often there is a tiny problem that has you scratching your head until you RTFM. I love <a href="http://bit.ly/wRcjs" target="_blank">JSON</a>, it&#8217;s totally awesome and the fact that you can not convert CF objects natively is even better! I ran into a small issue where I was using serializeJSON on a structure that contained a query object (don&#8217;t ask!). The problem was when the serialized string was deserialized using deserializeJSON the query was no longer a query, it was not a structure!  It turns out that the serializeJSON function takes <strong>two</strong> parameters!</p>
<blockquote><p>SerializeJSON(var[, serializeQueryByColumns])</p></blockquote>
<p>The second optional parameter <em>serializeQueryByColumns </em>tells CF to handle queries in a special way. Now the trick is to remember to use the <strong>second</strong> parameter of the DeserializeJSON function which performs the reverse operation. The second parameter must be set to <strong>false</strong> for the query object to be recreated during deserialization.</p>
<p>Here are links to the <a href="http://bit.ly/8IYMN5" target="_blank">serializeJSON</a> and <a href="http://bit.ly/8IYMN5" target="_blank">deserializeJSON</a> in LiveDocs.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s been a while</title>
		<link>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/</link>
		<comments>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 10:11:48 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=243</guid>
		<description><![CDATA[I&#8217;ve not posted anything on my blog for a while, it always amazes me how the top bloggers in the ColdFusion world find the time to post almost daily about tips, tricks, resources and I hardly every find the time to write a note to myself. My posts don&#8217;t seem as interesting or as insightful [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F12%2Fits-been-a-while%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F12%2Fits-been-a-while%2F" height="61" width="51" /></a></div><p>I&#8217;ve not posted anything on my blog for a while, it always amazes me how the top bloggers in the ColdFusion world find the time to post almost daily about tips, tricks, resources and I hardly every find the time to write a note to myself. My posts don&#8217;t seem as interesting or as insightful as some of the ones posted by the CF elite. I do thank them for their great posts and continued support of the ColdFusion community.</p>
<p>I&#8217;ve been working on a website recently that has soaked up all of my time. I&#8217;ve been having some problems with memory leaks and JVM tuning but I think I&#8217;ve finally found solutions to my problems and will be posting them in a separate article shortly which will hopefully help someone out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix/Int (Floor) function oddity in ColdFusion 8</title>
		<link>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 14:10:51 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ColdFusion 8]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=238</guid>
		<description><![CDATA[I&#8217;ve discovered an odd little &#8220;bug&#8221; in the Fix and Int functions in ColdFusion 8. The Fix/Int functions work similarly to the Floor function in other languages:
According to the ColdFusion 8 LiveDocs
Int - Calculates the closest integer that is smaller than number. For example, it returns 3 for Int(3.3) and for Int(3.7); it returns -4 for [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F07%2Ffixint-floor-function-oddity-in-coldfusion-8%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F07%2Ffixint-floor-function-oddity-in-coldfusion-8%2F" height="61" width="51" /></a></div><p>I&#8217;ve discovered an odd little &#8220;bug&#8221; in the Fix and Int functions in ColdFusion 8. The Fix/Int functions work similarly to the Floor function in other languages:</p>
<p>According to the ColdFusion 8 LiveDocs</p>
<p>Int - Calculates the closest integer that is smaller than number. For example, it returns 3 for Int(3.3) and for Int(3.7); it returns -4 for Int(-3.3) and for Int(-3.7)</p>
<p>Fix &#8211; Converts a real number to an integer. If number is greater than or equal to 0, the closest integer less than or equal to number. If number is less than 0, the closest integer greater than or equal to number.</p>
<p>Now, if you do #Fix(15)# or #Int(15)# the functions return the correct value of 15. However if you do #Fix((6.84/45.60) * 100)# or #Int((6.84/45.60) * 100)# the functions return 14 which is incorrect since the equation equates to 15.</p>
<p>Bug or Feature?</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFPOP and SSL</title>
		<link>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/</link>
		<comments>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 11:05:40 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CFPOP]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=220</guid>
		<description><![CDATA[One of the reasons I love Adobe&#8217;s ColdFusion so much is the fact that it is built on a Java engine and you are able to use a lot of the powerful features of Java from CF. I however don&#8217;t get to use this feature often enough, mainly because most of the things I work [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F04%2Fcfpop-and-ssl%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F04%2Fcfpop-and-ssl%2F" height="61" width="51" /></a></div><p>One of the reasons I love Adobe&#8217;s ColdFusion so much is the fact that it is built on a Java engine and you are able to use a lot of the powerful features of Java from CF. I however don&#8217;t get to use this feature often enough, mainly because most of the things I work on daily doesn&#8217;t really need anything other than what is provided by the CF natively. And, well, as with anything without practice your skills get dull, so when I had to access a mailbox that is hosted by Gmail using CFPOP I was forced to turn to Google to find a solution.</p>
<p>CFPOP does not support SSL/TLS connections as of version 8, which is quite a big limitation since so many services now support SSL for POP connections. There are quite a few options for work arounds for this but the simplest and quite elegant solution is the one provided by <a href="http://www.anujgakhar.com/2008/05/18/cfpop-and-gmail/">Anuj Gakhar</a>. This solution uses the underlying Java pop service which does support SSL.</p>
<blockquote><p> </p>
<p>&lt;cfset javaSystem = createObject(&#8220;java&#8221;, &#8220;java.lang.System&#8221;) /&gt;</p>
<p>&lt;cfset jProps = javaSystem.getProperties() /&gt;</p>
<p> </p>
<p>&lt;cfset jProps.setProperty(&#8220;mail.pop3.socketFactory.class&#8221;, &#8220;javax.net.ssl.SSLSocketFactory&#8221;) /&gt;</p>
<p><span> </span>&lt;cfset jProps.setproperty(&#8220;mail.pop3.port&#8221;, variables.popPort) /&gt;</p>
<p><span> </span>&lt;cfset jProps.setProperty(&#8220;mail.pop3.socketFactory.port&#8221;, variables.popPort) /&gt;</p>
<p> </p>
<p> </p></blockquote>
<p>Set variables.popPort to the port on which your POP server is accessed. You then call the CFPOP tag as you would normally:</p>
<blockquote><p>&lt;cfpop action=&#8221;getHeaderOnly&#8221;</p>
<p>            server=&#8221;#variables.popServer#&#8221;</p>
<p>            port=&#8221;#variables.popPort#&#8221;</p>
<p>            username=&#8221;#variables.popUsername#&#8221;</p>
<p>            password=&#8221;#variables.popPassword#&#8221;</p>
<p>            maxrows=&#8221;5&#8243;</p>
<p>            timeout=&#8221;60&#8243;</p>
<p>            name=&#8221;variables.popRecords&#8221; /&gt;</p></blockquote>
<p>The underlying Java platform can allow you to perform many tasks that may not be available in ColdFusion, so why not do some experiments?</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayPal Annoyances</title>
		<link>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/</link>
		<comments>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 09:58:18 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Paypal]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=195</guid>
		<description><![CDATA[This is a trivial post but Paypal integration has been a headache over the past few years which the manuals having incorrect information, differences between the UK and US apis and hugely unhelpful error codes. Things have gotten a bit better in recent times but still not as good as it should be given the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F03%2Fpaypal-annoyances%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F03%2Fpaypal-annoyances%2F" height="61" width="51" /></a></div><p>This is a trivial post but Paypal integration has been a headache over the past few years which the manuals having incorrect information, differences between the UK and US apis and hugely unhelpful error codes. Things have gotten a bit better in recent times but still not as good as it should be given the proliferation of Paypal integration. We recently had a little issue that had me banging my head against my keyboard. Now this <strong>IS</strong> in the api specification but I think this is a bit obsurd. </p>
<p>Apparently, you need to specify the amount as a decimal number to two decimal places otherwise the amount is flagged as invalid. So you must give your amount value as xx.xx and not xx.xxx or any other number of decimal places. You will receive an INVALID AMOUNT error and the transaction history in Paypal Manager will show INVALID AMOUNT $0.00 USD, even if you are using another currency.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting secure attribute of JSESSIONID cookie in ColdFusion 8</title>
		<link>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 10:57:55 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[PCI]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=177</guid>
		<description><![CDATA[As part of PCI compliance our servers were run through third party security auditing and one warning we received was &#8220;Missing Secure Attribute in an Encrypted Session (SSL) Cookie&#8221;. This warning referred to the JSESSIONID cookie being set in our SSL enabled pages not having the SECURE attribute set. In ColdFusion there is no way [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fsetting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fsetting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8%2F" height="61" width="51" /></a></div><p>As part of PCI compliance our servers were run through third party security auditing and one warning we received was &#8220;Missing Secure Attribute in an Encrypted Session (SSL) Cookie&#8221;. This warning referred to the JSESSIONID cookie being set in our SSL enabled pages not having the SECURE attribute set. In ColdFusion there is no way for you to do this programatically (since you would not explicitly create the JSESSIONID cookie) or even via the administrator. After a lot of searching and reading I found the solution thanks to comment on this post:</p>
<p><a href="http://www.bennadel.com/blog/785-Ask-Ben-Hiding-Encrypting-ColdFusion-CFID-And-CFTOKEN-Values.htm">http://www.bennadel.com/blog/785-Ask-Ben-Hiding-Encrypting-ColdFusion-CFID-And-CFTOKEN-Values.htm</a></p>
<p>The solution is quite simple, add:</p>
<blockquote><p>&lt;cookie-config&gt;<br />
&lt;cookie-secure&gt;true&lt;/cookie-secure&gt;<br />
&lt;/cookie-config&gt;</p></blockquote>
<p>after the &lt;/persistence-config&gt; element in your jrun-web.xml file which is usually located in C:\JRun4\servers\yourservername\cfusion-ear\cfusion-war\WEB-INF\jrun-web.xml. If you are running in multiserver mode of CF Enterprise and have multiple application instances, you must add this to the jrun-web.xml of every application instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web data security paranoia</title>
		<link>http://thinkinglemur.com/index.php/2009/02/web-data-security-paranoia/</link>
		<comments>http://thinkinglemur.com/index.php/2009/02/web-data-security-paranoia/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 13:41:48 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=174</guid>
		<description><![CDATA[My recent experiences with several hacking attacks has made me think more about application and data security on the web. In today&#8217;s world nothing can be taken for granted and security should be of the highest concern, no mater how simple you think your application or trivial the data you store. Many web applications are [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fweb-data-security-paranoia%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fweb-data-security-paranoia%2F" height="61" width="51" /></a></div><p>My recent experiences with several hacking attacks has made me think more about application and data security on the web. In today&#8217;s world nothing can be taken for granted and security should be of the highest concern, no mater how simple you think your application or trivial the data you store. Many web applications are hosted on shared servers or virtual private servers where the first line of defense is often left to the hosting provider. The first line of defense is perimeter security such as hardware firewalls and other network related prevention. You are also at the hands of the hosting provider when it comes to software security, that is, your operating system, web server, application servers and scripting languages and ftp patches.</p>
<p>The first thing that and good security plan should have is a proper review of these basic things. Contact your hosting provider and find out about patch management and other security options that may be their responsibility. If you manage your own server then you need to be aware of firewalls (software or hardware), antivirus, patch management and user security.</p>
<p>Now, on to your web application security. In my previous article on <a href="http://thinkinglemur.com/index.php/2009/02/preventing-sql-injection-attacks-in-coldfusion/">preventing sql injection attacks in coldfusion</a>  there are quite a few tips for securing the applications. One other place developers tend to ignore is the transmission of data to and storage of data in the database. So let&#8217;s look at some of the options for securing data.</p>
<p><strong>Database access:</strong></p>
<p>If your budget supports it, the first thing that should be implemented would be to have your database on a separate physical machine from your application server or public web server. This has two positive effects. Firstly, moving the database server to another machine will take the load off the web server or application server which can only be a good thing. Secondly, you public web server would be the first machine to be attacked, thus if a breach were to occur having the database on another machine would add some level of defense.</p>
<p>Ensure that the web application database user has the bare minimum rights to the database. That is, if the web application has no need to add tables or drop tables then the user should not have CREATE or DROP rights. Ensure, under no circumstances that your web application uses ROOT, SA or any other master login to access your database. Create a separate user for each application and give it the required rights.</p>
<p>One other thing I like to do is limit remote access to the database, if you can get SSH/RDP access to the server limit that to specific IP addresses. This causes remote administration to be a pain but the security benefits outweight the inconvenience.</p>
<p> </p>
<p><strong>Data storage:</strong></p>
<p>Now, once you have the correct rights on your database and secured it from web access the next step would be to secure the actual data being stored. You will want to ensure that the forms that submit information are secured with a valid strong SSL certificate. Now, you may not be interested in using SSL encryption for all forms on  your site but it is a good practice to secure forms such as registration, login, shopping carts and checkout forms. Basically, any form that has any user information should be secured.</p>
<p>This same thinking should extend to storing the data in the database. Many developers encrypt passwords and store them in the database, but I think other things like usernames, email addresses and any other information that can potential be regarded as sensitive information should be encrypted and stored in the database. There are two options for this. Let the database encrypt the data for you or let your application encrypt the data before it is inserted in the database.</p>
<p>In SQL Server 2005, you can achieve this using some special functions. You can read more about this method in the following articles:</p>
<blockquote><p><a href="http://www.sql-server-performance.com/articles/dev/encryption_2005_1_p1.aspx">http://www.sql-server-performance.com/articles/dev/encryption_2005_1_p1.aspx</a></p>
<p><a href="http://www.sql-server-performance.com/articles/dev/encryption_2005_2_p1.aspx">http://www.sql-server-performance.com/articles/dev/encryption_2005_2_p1.aspx</a></p></blockquote>
<p>Other popular databases would have similar features.</p>
<p>The other option would be to encrypt the data before storing it in the database and then decrypting it when it needs to be used. In ColdFusion, this can be achieved using the encrypt and decrypt functions. These functions allow you to choose and encryption algorithm (SHA1, Blowfish etc) and a security key. The major drawback to this method is speed. This would slow down the communication of data between the web application and the user, however I think this is a fair trade off for the security concious.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/02/web-data-security-paranoia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preventing SQL Injection attacks in ColdFusion</title>
		<link>http://thinkinglemur.com/index.php/2009/02/preventing-sql-injection-attacks-in-coldfusion/</link>
		<comments>http://thinkinglemur.com/index.php/2009/02/preventing-sql-injection-attacks-in-coldfusion/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 14:17:32 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=143</guid>
		<description><![CDATA[This is an article I came across on Ben Forta&#8217;s blog. This gives some very good tips on preventing SQL  injection attacks and provides some excellent best practices.
 http://www.adobe.com/devnet/coldfusion/articles/sql_injection.html
When I took up my current position we had to do a vulnerability scan to become PCI compliant and well we originally failed horribly. After much work we [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fpreventing-sql-injection-attacks-in-coldfusion%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fpreventing-sql-injection-attacks-in-coldfusion%2F" height="61" width="51" /></a></div><p>This is an article I came across on <a href="http://www.forta.com">Ben Forta&#8217;s blog</a>. This gives some very good tips on preventing SQL  injection attacks and provides some excellent best practices.</p>
<blockquote><p> <a href="http://www.adobe.com/devnet/coldfusion/articles/sql_injection.html">http://www.adobe.com/devnet/coldfusion/articles/sql_injection.html</a></p></blockquote>
<p>When I took up my current position we had to do a vulnerability scan to become PCI compliant and well we originally failed horribly. After much work we got it compliant and fixed all of the security holes identified. The article above gives some ColdFusion specific items but also defines some techniques that can be applied to other languages. A few things that are of note are:</p>
<ul>
<li>Database user privileges</li>
<li>Use of stored procedures</li>
<li>Use of dynamic table names</li>
</ul>
<p>These three points are usually overlooked by the average developer and should really be implemented. </p>
<p> </p>
<p>Database User Access:</p>
<p>Only give the user the minimum rights required to perform the task. So if your user only needs to perform select and update operations they should not have delete, create or other rights.</p>
<p> </p>
<p>Stored Procedures:</p>
<p>Stored procedures provide a very good way to abstract and hide database logic from your code. This is a problem with many of the frameworks that use Active Record patterns like Rails and CakePHP or ORM systems like Reactor in ColdFusion but stored procedures can provide significant performance improvements as well as having security benefits.</p>
<p> </p>
<p>Dynamic Table Names:</p>
<p>By prefixing your database tables with a custom string, you can build queries that use a dynamic string for accessing the table information instead of hardcoding the table name. This is another good idea since many systems use generic table names like users, categories, groups etc which can be easily guessed.</p>
<p> </p>
<p>It is very important to analyse every section of code and perform a security audit ensuring that all forms are protected since this is the first place that attackers target.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/02/preventing-sql-injection-attacks-in-coldfusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
