<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>TheRealTimeWeb.com - ColdFusion</title>
			<link>http://www.therealtimeweb.com/index.cfm</link>
			<description>A technology blog with a special focus on real-time web technologies, web video and the Flash Platform.</description>
			<language>en-us</language>
			<pubDate>Sat, 25 May 2013 03:08:45 +0100</pubDate>
			<lastBuildDate>Tue, 28 Feb 2012 08:34:00 +0100</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>stefan@therealtimeweb.com</managingEditor>
			<webMaster>stefan@therealtimeweb.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>stefan@therealtimeweb.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>Easily Monitor Log File Output in OSX Terminal (tail -F)</title>
				<link>http://www.therealtimeweb.com/index.cfm/2012/2/28/debugging-using-tail</link>
				<description>
				
				Here&apos;s a quick tip that is a real time saver in some situations. As a developer you often come across programs, tools or servers that produce output in form of a log file. Or maybe - and this includes myself - you use logs for debugging purposes.&lt;p&gt;
In ColdFusion for example I regularly find myself adding cflog tags to my code in order to get a view into what my code is doing. Having to open and close log files constantly can be tedious at best, but luckily there is a really simple way of displaying a live view of the most recent entries using the standard Unix tail -F command.&lt;p&gt;
Whereas tail on its own simply displays the last part of a file, the -F option will not stop when the end of the file is reached but will keep monitoring the file for new lines and displaying them, thereby giving you effectively a live console view into the file.&lt;p&gt;
Taking ColdFusion logs as an example, here&apos;s how you&apos;d monitor a particular log file (mine are typically named according to the site or application I am working on):&lt;br&gt;
&lt;code&gt;
cd /Applications/ColdFusion9/logs/
tail -F playingornot.log 
&quot;Information&quot;,&quot;jrpp-4&quot;,&quot;02/21/12&quot;,&quot;17:40:30&quot;,&quot;PLAYINGORNOT&quot;,&quot;/index.cfm&quot;
&quot;Information&quot;,&quot;jrpp-5&quot;,&quot;02/21/12&quot;,&quot;17:40:33&quot;,&quot;PLAYINGORNOT&quot;,&quot;/index.cfm&quot;
&quot;Information&quot;,&quot;jrpp-5&quot;,&quot;02/21/12&quot;,&quot;17:40:35&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/Auth.cfc&quot;
&quot;Information&quot;,&quot;jrpp-5&quot;,&quot;02/21/12&quot;,&quot;17:40:35&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/Players.cfc&quot;
&quot;Information&quot;,&quot;jrpp-5&quot;,&quot;02/21/12&quot;,&quot;17:40:36&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/PlayTimes.cfc&quot;
&quot;Information&quot;,&quot;jrpp-1&quot;,&quot;02/28/12&quot;,&quot;09:37:37&quot;,&quot;PLAYINGORNOT&quot;,&quot;/index.cfm&quot;
&quot;Information&quot;,&quot;jrpp-1&quot;,&quot;02/28/12&quot;,&quot;09:37:40&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/Auth.cfc&quot;
&quot;Information&quot;,&quot;jrpp-1&quot;,&quot;02/28/12&quot;,&quot;09:37:41&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/Players.cfc&quot;
&quot;Information&quot;,&quot;jrpp-1&quot;,&quot;02/28/12&quot;,&quot;09:37:42&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/PlayTimes.cfc&quot;
&quot;Information&quot;,&quot;jrpp-2&quot;,&quot;02/28/12&quot;,&quot;09:40:30&quot;,&quot;PLAYINGORNOT&quot;,&quot;/cfc/PlayTimes.cfc&quot;
&lt;/code&gt;
&lt;p&gt;
As my application runs I can see new entries being displayed in real time in my log file - very handy. This particular log is produced by adding 
&lt;code&gt;
&lt;cflog file=&quot;#this.name#&quot; type=&quot;information&quot; text=&quot;#arguments.targetPage#&quot;&gt;
&lt;/code&gt;
to my Application.cfc&apos;s OnRequestStart handler.
&lt;p&gt;
This technique works for any kind of text based log file on operating systems that have the tail command or similar available.
				</description>
				
				<category>ColdFusion</category>
				
				<category>Tools</category>
				
				<category>Tutorials</category>
				
				<pubDate>Tue, 28 Feb 2012 08:34:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2012/2/28/debugging-using-tail</guid>
				
				
			</item>
			
			<item>
				<title>Uploading Files To Amazon S3 With ColdFusion</title>
				<link>http://www.therealtimeweb.com/index.cfm/2011/11/25/cf-upload-to-s3</link>
				<description>
				
				Since version 9.0.1 (if I am not mistaken) ColdFusion supports Amazon&apos;s S3 file storage pretty much out of the box. The complexities of access control to your bucket is abstracted away and you can use S3 almost like a local file system. You can read more about it in the CF docs and on &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2010/7/15/CF901-Guide-to-Amazon-S3-support-in-ColdFusion-901&quot; target=&quot;_blank&quot;&gt;Ray Camden&apos;s blog&lt;/a&gt;.&lt;p&gt;
My task at hand was to accept user submitted file uploads and store them in S3. According to the CF documentation the full set of cffile operations is supported, however I could not get it to work. &lt;br&gt;
The following failed for me with a &apos;destination invalid&apos; error:&lt;br&gt;
&lt;code&gt;
&lt;cfset mydir = &quot;s3://media.mysite.com/logos&quot;&gt;
&lt;cffile action=&quot;upload&quot; filefield=&quot;logo&quot; destination=&quot;#mydir#&quot; nameconflict=&quot;makeunique&quot; charset=&quot;utf-8&quot; /&gt;
&lt;/code&gt;&lt;p&gt;
Please note that in order for the s3:// syntax to resolve to your bucket you need to follow &lt;a href=&quot;http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSd160b5fdf5100e8f-4439fdac128193edfd6-7f08.html&quot; target=&quot;_blank&quot;&gt;some setup steps&lt;/a&gt; which I won&apos;t cover here. Also watch out for a &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2011/2/7/ColdFusion-S3-Implementation-bug-with-metadata-and-ACLs&quot; target=&quot;_blank&quot;&gt;bug related to setting metadata&lt;/a&gt;.&lt;p&gt;
The way I managed to work around the bug related to not being able to upload files directly into S3 I uploaded to my CF server first and then effectively moved the image into S3. This seemed to work:&lt;br&gt;
&lt;code&gt;
&lt;cfset mydir = &quot;s3://media.mysite.com/logos&quot;&gt;

&lt;!--- upload to own server ---&gt;
&lt;cffile action=&quot;upload&quot; filefield=&quot;logo&quot; destination=&quot;#expandpath(&apos;./&apos;)#&quot; nameconflict=&quot;makeunique&quot; charset=&quot;utf-8&quot; /&gt;
&lt;!--- create a unique name to save the image as ---&gt;
&lt;cfset logoImage = &quot;#createUUID()#.#cffile.serverFileExt#&quot; /&gt;
    
&lt;cfset imgPathLocal = &quot;#expandpath(&apos;./&apos;)#/#cffile.serverFile#&quot;&gt;
    
&lt;!--- open local image, then write to S3 ---&gt;
&lt;cfset localImage = imageRead(&quot;#imgPathLocal#&quot;)&gt;
&lt;cfset imageWrite(localImage, &quot;#mydir#/#logoImage#&quot;)&gt;
     
&lt;!--- set permissions on the newly created file on S3 ---&gt;
 &lt;cfset perms = [
      {group=&quot;all&quot;, permission=&quot;read&quot;}
  ]&gt;
&lt;cfset StoreAddACL(&quot;#mydir#/#logoImage#&quot;,&quot;#perms#&quot;)&gt;	
        
&lt;!--- delete the local image now ---&gt;
&lt;cfif fileexists(&quot;#imgPathLocal#&quot;)&gt;
	 &lt;cffile action=&quot;delete&quot; file=&quot;#imgPathLocal#&quot;&gt;
&lt;/cfif&gt;

&lt;/code&gt;
&lt;p&gt;
Note that this code is untested in its current form but should give you the idea. Hope it helps.
				</description>
				
				<category>ColdFusion</category>
				
				<category>Tutorials</category>
				
				<pubDate>Fri, 25 Nov 2011 09:52:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2011/11/25/cf-upload-to-s3</guid>
				
				
			</item>
			
			<item>
				<title>System.Runtime.InteropServices.ExternalException With .NET in ColdFusion</title>
				<link>http://www.therealtimeweb.com/index.cfm/2011/7/8/net-error-in-cf</link>
				<description>
				
				Just a brief heads up if you are working with .NET components in ColdFusion. I&apos;ve recently ported some CF code to a new server and suddenly saw this cryptic error: &quot;System.Runtime.InteropServices.ExternalException&quot;. &lt;p&gt;
It appeared that the line of code that was causing the error was 
&lt;code&gt;
&lt;cfset img.Save(&quot;#newimg#&quot;)&gt;
&lt;/code&gt;
in which img is an instance of a .NET Bitmap object. I persevered and managed to get some clues from various .NET posts, some of which pointed at file system problems. I was able to determine that I was trying to write to a non-existent directory when calling the img.Save method. I fixed the directory path and pointed it to a valid location and it solved my issue. &lt;p&gt;
An easy fix in the end but potentially hard to track down. And before you say anything, yes I should have wrapped all of this in a DirectoryExists() method in the first place :-)
				</description>
				
				<category>ColdFusion</category>
				
				<pubDate>Fri, 08 Jul 2011 16:39:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2011/7/8/net-error-in-cf</guid>
				
				
			</item>
			
			<item>
				<title>Trimming ColdFusion List Items For Use In Cfqueryparam</title>
				<link>http://www.therealtimeweb.com/index.cfm/2011/6/23/coldfusion-listitems-trim-spaces-cfqueryparam</link>
				<description>
				
				Yesterday I was working on a new feature for the Scribblar.com API that would allow users to delete multiple rooms at once by passing in a series of roomids (in my case those roomids are varchars, an example roomid would be &apos;g8m2ps88&apos;).&lt;br&gt;
In order to process these easily in one SQL statement I wanted to use the SQL IN statement.
&lt;code&gt;
SELECT roomid, id from rooms
WHERE roomid IN ( &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#roomidlist#&quot; list=&quot;true&quot; separator=&quot;,&quot; /&gt; )
&lt;/code&gt;
This worked fine if the roomids were defined without spaces in between. The following list worked fine:
&lt;code&gt;
&lt;cfset roomids=&quot;g8m2ps88,u3s29kk&quot;&gt;
&lt;/code&gt;
The following worked without errors, but returned the wrong number of results:
&lt;code&gt;
&lt;cfset roomids=&quot;g8m2ps88, u3s29kk&quot;&gt;
&lt;/code&gt;
Spaces between the list elements would result in only one result from the SELECT IN query and I knew that that was wrong, I should see two results. It appeared that the list attribute in cfqueryparam would ignore any items after the space, even though dumping a Listlen(roomids,&quot;,&quot;) would correctly show all three items. 
&lt;p&gt;
I had several options for fixing this, and since my roomids never contain any spaces themselves I simply removed any spaces that may exist. This is what I am using now:
&lt;code&gt;
SELECT roomid, id from rooms
WHERE roomid IN ( &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#Replace(roomids, &apos; &apos;, &apos;&apos;, &apos;all&apos;)#&quot; list=&quot;true&quot; separator=&quot;,&quot; /&gt; )
&lt;/code&gt;
I double checked with &lt;a href=&quot;http://www.coldfusionjedi.com/&quot; target=&quot;_blank&quot;&gt;Ray Camden&lt;/a&gt; as I wasn&apos;t sure if I had overlooked another obvious solution (thanks for your advice Ray!), but Mr Jedi himself approved of my workaround - the only caveat being that this will not work if your roomids contain spaces themselves (such as &apos;3kd 933js&apos;).&lt;p&gt;
Hope this helps someone, it certainly took me a little while to figure out what was going on.
				</description>
				
				<category>ColdFusion</category>
				
				<pubDate>Thu, 23 Jun 2011 12:23:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2011/6/23/coldfusion-listitems-trim-spaces-cfqueryparam</guid>
				
				
			</item>
			
			<item>
				<title>Some Tips For ColdFusion Remoting Over SSL in Flex</title>
				<link>http://www.therealtimeweb.com/index.cfm/2011/4/20/cf-remoting-ssl-flex</link>
				<description>
				
				I apologise in advance for this slightly unstructured post but this topic has been in the back of my mind for a while, so before I completely forget the details I btter write it down.&lt;p&gt;
I&apos;ve recently had to port one of my Flex applications, a simple CRUD admin console hitting a MySQL database via CF9, to use a Remoting connection over SSL. I recalled hat in the past this setup had given me some headaches: &apos;normal&apos; CF Remoting from Flex over HTTP was pretty simple to get going, but switching to HTTPS had not been as simple. Therefore here is a quick checklist (and note: it may be incomplete) if you have the same task at hand.&lt;p&gt;1) Make sure your Flex project contains a services-config.xml to compile against. Consule the Flex docs for more details on this, but I usually stickl the services-config file into my project&apos;s /src folder for easy access and simple path structure.&lt;p&gt;
2) Go to your Flex project&apos;s properties &gt; Flex Compiler and under &apos;additional compiler arguments&apos; add &lt;code&gt;-services &quot;services-config.xml&quot;&lt;/code&gt;&lt;p&gt;
3) Make sure the services-config file has a channel-definiton which contains class=&quot;mx.messaging.channels.SecureAMFChannel&quot;&lt;br&gt;
You will use this as your SSL channel. The endpoint should be configured to point to your remote CF server and gateway (at least that&apos;s what I do as I develop against a remote server), for example:&lt;br&gt;
&lt;endpoint uri=&quot;https://yourserver.com/flex2gateway/cfamfsecure&quot; class=&quot;flex.messaging.endpoints.SecureAMFEndpoint&quot;/&gt;&lt;p&gt;
A good way to test if the gateway is working (at least at the surface) is to hit it with a browser. You should see a blank page. Anything else spells trouble and will mean your remoting calls will not work. &lt;p&gt;
4) Your services-config file likely already contains a destination with the id ColdFusionSSL. Make sure that its channel ref value &apos;points&apos; to the id of the channel-definition you just created or modified. 
&lt;p&gt;
As far as the Flex side goes that&apos;s pretty much it, you are good to go (but before you run off and try this, there is one more important tip further down). Just remember to use that new destination when you set up your RemoteObject:
&lt;code&gt;
var ro:RemoteObject = new RemoteObject();
ro.destination = &quot;ColdFusionSSL&quot;;
&lt;/code&gt;
&lt;p&gt;
At this point I wondered why my application was throwing remoting related errors.  Quick tip: if you are still using Flex 3 (maybe Flex 4 has an equivalent) then add the folloiwng tag anywhere to your main application file:&lt;br&gt;
&lt;code&gt;
&lt;mx:TraceTarget/&gt;
&lt;/code&gt;
This will result in some remoting related traces that may give clues to potenbtial errors. Also remember to use the Network Monitor in Flex, it&apos;s pretty neat for debugging remoting calls.&lt;p&gt;
Ok, I promised one more caveat and this one had be stuck for a while. I was not aware that ColdFusion (the server itself) also needs to be told about the new destination you created. My CF server has the necessary files stored under C:\ColdFusion9\wwwroot\WEB-INF\flex - you need to check remoting-config.xml and services-config.xml and make sure that remoting-config.xml contains a destination called ColdFusionSSL with a channel-ref named my-cfamf-secure. If I remember correctly my CF server did not have this entry, yet the services-config file on CF had the channel-definition my-cfamf-secure. &lt;p&gt;
I&apos;ve never quite understood why Adobe have made this whole setup so darn complicated. I remember the days of AS2 when a Remoting call in Flash could be made in something like 3 lines of code without the need for any XML config files.
&lt;p&gt;
But I&apos;m not claiming that I quite know what;&apos;s happening here, but what I do know is that I had to touch XML files on both the client (in my Flex project)  and my server to get SSL based Remoting to work with CF. I&apos;m not going to touch it again now in case I&apos;ll break it :-)
				</description>
				
				<category>Flex</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Wed, 20 Apr 2011 16:20:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2011/4/20/cf-remoting-ssl-flex</guid>
				
				
			</item>
			
			<item>
				<title>Configuring an Access Database on ColdFusion for 64bit Windows 2008</title>
				<link>http://www.therealtimeweb.com/index.cfm/2011/2/21/coldfusion-access-database-windows-64bit</link>
				<description>
				
				I&apos;ve just had to move a website from one Windows 2008 R2 Server (64bit) to another. The site was running on an Access database backend (don&apos;t ask...!) and I had forgotten how I managed to set up the datasource a couple of years ago - however I do remember that it was a PITA. &lt;p&gt;
Unsurprisingly it took me a good 2 hours again today until the site was back up and running on the new server and there were a couple of things involved (at least I think these two steps are the important ones):&lt;br&gt;
1) Make sure your site runs in a 32bit Application Pool in IIS. Ok, admittedly I am no longer 100% sure if this is needed but it works for me. I set up the site in IIS and configured it to use its own separate Application Pool. Then I selected &apos;Application Pools&apos; in the tree under the server node in IIS, selected my site&apos;s Application Pool, then chose &apos;Advanced Settings&apos; on the right under &apos;Edit Application Pool&apos; and in the window that opened I set &apos;Enable 32-Bit Applications&apos; to True. I also changed the &apos;.NET Framework Version&apos; to &apos;No managed code&apos; in order to disable .NET altogether for this site (it does not use .NET and I think some server error 500s I was seeing were caused by this, however I cannot be sure anymore. What I am sure about though is that my site works using this setting :-)&lt;p&gt;
2) Next I needed to set up the datasource. Usually you do this in CF Admin but if you try this on a 64bit Windows machine it is likely that you&apos;re presented with an error. If you use the OS&apos;s ODBC Data Source Admin then you won&apos;t see any Access Drivers listed because the default ODBC Admin is the 64bit version and that one does not have an Access Driver. You must therefore use the 32bit version which can be found at C:\Windows\SysWOW64\odbcad32.exe&lt;p&gt;
Once I set up my datasource using this tool I was able to get my site up and running again.
&lt;br&gt;Hope this helps someone. And no, the site in question is not this blog :-P
				</description>
				
				<category>ColdFusion</category>
				
				<category>Windows</category>
				
				<category>General</category>
				
				<pubDate>Mon, 21 Feb 2011 22:19:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2011/2/21/coldfusion-access-database-windows-64bit</guid>
				
				
			</item>
			
			<item>
				<title>Securing Remoting Access To ColdFusion CFCs From Flex</title>
				<link>http://www.therealtimeweb.com/index.cfm/2010/6/21/securing-cfc-access-from-flex</link>
				<description>
				
				Today I was working on a Flex application which uses a lot of Remoting calls to a bunch of ColdFusion CFC methods. I wondered what the most efficient way of securing these methods would be since they are effectively wide open to the world as they all (have to) specify access=&amp;quot;remote&amp;quot;. This means that anyone with a web browser can invoke the methods and they will even return nice error messages when certain parameters are missing.&lt;br /&gt;
One way of restricting access would be to run all Remoting calls through an intermediate page or CFC which handles authentication and access control and which in turn invokes the (now private) CFC methods. I found this a bit cumbersome and I also knew that there was a better way - I remembered the setCredentials method back from the AS2 days. You can see this described in greater detail by &lt;a href=&quot;http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;amp;entry=978&quot; target=&quot;_blank&quot;&gt; Brandon Purcell&lt;/a&gt; in his MAX session &lt;a href=&quot;http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;amp;entry=978&quot;&gt;Securing  Applications&lt;/a&gt; from 2003(!), but unfortunately it is not directly usable in today&apos;s Flex world.
&lt;/p&gt;
&lt;p&gt;While Brandon&apos;s example is great, and &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2006/11/25/Last-build-of-my-Flex-2ColdFusion-Security-Homework&quot; target=&quot;_blank&quot;&gt;Ray Camden&lt;/a&gt; also has &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2006/11/25/Last-build-of-my-Flex-2ColdFusion-Security-Homework&quot; target=&quot;_blank&quot;&gt;some details&lt;/a&gt; to add, neither example had all the pieces I needed, particularly an example of not just authenticating a Flex application properly with a CFC but also how to log out again (and to jump ahead, simply running a cflogout tag did not work...).&lt;/p&gt;&lt;p&gt;I ended up using a combination of what Ray did, plus roughly the logic Brandon deployed, and added a Flex example to show (like Ray) how to call a secured and an unsecured CFC method. In addtion I added a separate, explicit call to Flex&apos;s setRemoteCredentials() on the RemoteObject class in order to trigger the cflogin logic in ColdFusion&apos;s Application.cfc. &lt;br /&gt;
  &lt;br /&gt;
  Unfortunately I cannot show you a working example, but I am providing the &lt;a href=&quot;/downloads/FlexCredentials.zip&quot; target=&quot;_blank&quot;&gt;sources for the Flash Builder project and CF files&lt;/a&gt;. Note that my example is set up to run on localhost, and I also specified a compiler flag of -locale en_US -services &quot;services-config.xml&quot; in Flash Builder. 
  My services-config file is also included. &lt;br /&gt;
  &lt;br /&gt;
Here&apos;s how I structured my &lt;a href=&quot;/downloads/FlexCredentials.zip&quot; target=&quot;_blank&quot;&gt;example&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt; 1) Application.cfc: this file contains an onRequestStart which gets invoked on every request to this application, including cfm pages as well as cfcs. It contains a cflogin tag which executes only if the user making the request has *not* yet been authenticated. Inside the cflogin tag is a cfif tag which logs the current user in as long as the necessary credentials are passed in - this happens by using setRemoteCredentials() on RemoteObject in Flex/ActionScript.
&lt;code&gt;
&lt;cfcomponent&gt;

	&lt;cfset This.name = &quot;FlexCredentials&quot;&gt; 
	    
    &lt;cffunction name=&quot;onRequestStart&quot; returnType=&quot;boolean&quot; output=&quot;false&quot;&gt;
        &lt;cfargument name=&quot;thePage&quot; type=&quot;string&quot; required=&quot;true&quot;&gt;
        
        &lt;cflogin&gt;
            &lt;cfif isDefined(&quot;cflogin.name&quot;) and isDefined(&quot;cflogin.password&quot;)&gt;
            	&lt;!--- normally you would add authentication logic here, verify the username and password before running the next line - I do it the simple way ---&gt;
                &lt;cfif cflogin.name eq &quot;stefan&quot;&gt;
            		&lt;cfloginuser name=&quot;#cflogin.name#&quot; password=&quot;#cflogin.password#&quot; roles=&quot;Client&quot;&gt;
            	&lt;/cfif&gt;
            &lt;/cfif&gt;
        &lt;/cflogin&gt;
        
        &lt;cfreturn true&gt;
    &lt;/cffunction&gt;
    

    &lt;cffunction name=&quot;onApplicationStart&quot;&gt; 
        &lt;cfreturn True&gt; 
    &lt;/cffunction&gt;

&lt;/cfcomponent&gt;
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;2) MyComponent.cfc: This file contains all the remote methods we call from Flex. One method (called &apos;normalMethod&apos;) can be called by any user (unauthenticated), another can only be called once logged in, and a third is used to log out (more details on that below).&lt;br /&gt;
  Access control is provided by using the CFC&apos;s built-in roles attribute. An authenticated user is assigned a role of &apos;Client&apos;  and the &apos;secureMethod&apos; in the CFC is locked down by specifying that role. 
&lt;code&gt;
&lt;cfcomponent hint=&quot;A test for CFLOGIN from Flex using RemoteObject and setRemoteCredentials&quot;&gt;
	
    &lt;cffunction name=&quot;normalMethod&quot; access=&quot;remote&quot; returntype=&quot;String&quot;&gt;
		&lt;cfreturn &quot;Unsecured CFC method called successfully.&quot;&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;secureMethod&quot; access=&quot;remote&quot; roles=&quot;Client&quot;&gt;
		&lt;cfset response = &quot;Success. Secure method called by &quot; &amp; getAuthUser()&gt;
		&lt;cfreturn response&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;logoutMethod&quot; access=&quot;remote&quot;&gt;
		&lt;cflogout&gt;
		&lt;cfset response=&quot;Logged Out Succesfully&quot;&gt;
		&lt;cfreturn response&gt;
	&lt;/cffunction&gt;

&lt;/cfcomponent&gt;
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;3) The Flex Application: this is slightly more complex than it needed to be for the purposes of this example, but hopefully it&apos;s not too confusing. Rather than trying to explain the classes in detail please feel free to post any questions you may have in the comments below. &lt;br /&gt;
  &lt;br /&gt;
  &lt;strong&gt;Log Out Issues&lt;/strong&gt;&lt;br /&gt;
  In detail, what I was seeing was that I could still invoke the secure method from Flex after I had run the CFC&apos;s logout method and included cflogout tag. Switching directly to the browser - keeping the Flex app open in another tab -  did NOT allow me to invoke the secure CFC method, so from that angle the cflogout tag appeared to had done its job. &lt;br /&gt;
  To really &apos;kill&apos; the user&apos;s session inside the Flex app itself I had to explicitly call setRemoteCredentials again from Flex passing invalid login credentials. I have a theory on what is happening: the logout method does do its job as described and the user is actually logged out, but only until he tries to invoke another CFC method via the Flex app. As soon as that happens, Flex will re-send the previously set credentials (username, password) and re-authenticate the user using the cflogin tag in Application.cfc. This can apparently be confirmed by invoking the CFC method directly using a web browser both after the logout method has been called and then again after another CFC method has been invoked via Flex. Calling it via the browser after invoking logout in Flex results in a failed request, but after the next call from Flex it succeeds in the browser. For that reason I recommend to send a setRemoteCredentials(null, null) if you don&apos;t want the Flex user to be able to call any further methods unless he re-authenciates (bascially logs in again via some sort of login form which re-runs setRemoteCredentials() using valid credentials. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;I tried to find other ways for logging the user out and looking through some of the AS sources in Flex, it appeared that ro.channelSet.authenticated
may be a good flag for deciding if a user is logged in or not, however it always returned false for me regardless of whether or not the user was logged on... I tried logging the user out via ro.channelSet.logout() as well as ro.logout() but neither function seemed to actually do anything. If you have any idea if and how this is used with Remoting please let me know.    &lt;/p&gt;
&lt;p&gt;So all in all, keeping the slight caveats above in mind, the combination of CFCs with role based ecurity applied and the setRemoteCredentials() method on the RemoteObject class in ActionScript work well and are easy to implement. Unfortunately the documentation in Flash Builder only covers part of the process, and the CF docs cover another part - the CF side. It takes some work to string both parts together, but once implemented the process works pretty well. Now that I got my head around it I am ready to hook this into my control panel application. &lt;br /&gt;
You can &lt;a href=&quot;/downloads/FlexCredentials.zip&quot; target=&quot;_blank&quot;&gt;download all sources&lt;/a&gt; (Flex and CF) in form of a &lt;a href=&quot;/downloads/FlexCredentials.zip&quot; target=&quot;_blank&quot;&gt;Flash Builder project file here&lt;/a&gt; - note that you should rename the downloaded FlexCredentials.zip to FlexCredentials.fxp as it is a Flash Builder project file.&lt;/p&gt;
				</description>
				
				<category>Flex</category>
				
				<category>ColdFusion</category>
				
				<category>Applications</category>
				
				<pubDate>Mon, 21 Jun 2010 14:01:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2010/6/21/securing-cfc-access-from-flex</guid>
				
				
			</item>
			
			<item>
				<title>Installing ColdFusion 9 on Windows Server 2008 64bit</title>
				<link>http://www.therealtimeweb.com/index.cfm/2009/11/19/cf9-windows2008</link>
				<description>
				
				This blog is slowly turning into a ColdFusion site it seems :-) Blame ColdFusion for that, it&apos;s the one application server that I know a bit about and I really like working with.&lt;br&gt;
Today I needed to install CF9 on Windows Server 2008 64bit and I ran into a few issues which forced me to reinstall a few times. I&apos;ve now managed to install it successfully so here are a two tips that may safe you some hassle if you like me encounter a HTTP Error 404.3 - Not Found.&lt;p&gt;
First off, I was using IIS 7.5. As you may know, you need to install the web server role onto Windows Server 2008 first and it seems that everything labeled IIS6 tools and compatibility tools should be installed as well, so do that first. Then when running the CF installer right click and &apos;Run as Administrator&apos;. Once I did that it was plain sailing, but not much joy without those two boxes ticked.
				</description>
				
				<category>ColdFusion</category>
				
				<category>Windows</category>
				
				<category>General</category>
				
				<pubDate>Thu, 19 Nov 2009 18:23:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2009/11/19/cf9-windows2008</guid>
				
				
			</item>
			
			<item>
				<title>Installing ColdFusion 9 on OSX Snow Leopard with MAMP</title>
				<link>http://www.therealtimeweb.com/index.cfm/2009/11/2/cf9-mamp-snowleopard</link>
				<description>
				
				&lt;img src=&quot;http://www.flashcomguru.com/images/cf.jpg&quot; align=&quot;left&quot; hspace=&quot;7&quot; vspace=&quot;7&quot;&gt;I&apos;ve had a few issues getting ColdFusion 9 to run under OSX when trying to leverage an existing MAMP install (note: I was not using MAMP Pro. If you are using MAMP Pro then &lt;a href=&quot;http://blog.flashgen.com/2009/06/16/configuring-coldfusion-mamp-pro/&quot; target=&quot;_blank&quot;&gt;Mike&lt;/a&gt; has got &lt;a href=&quot;http://blog.flashgen.com/2009/06/16/configuring-coldfusion-mamp-pro/&quot; target=&quot;_blank&quot;&gt;some advice&lt;/a&gt; for you).&lt;p&gt;
I have not got enough time right now to run the whole install process again and take screenshots along the way but I&apos;ll do my best to summarise what I think may help some others who want to use MAMP and CF9 together. I took some hints from &lt;a href=&quot;http://blog.paulpounder.com/?p=27&quot; target=&quot;_blank&quot;&gt;this excellent post&lt;/a&gt; by Paul Pounder, however my install differed in that I chose a single server installation. Saying that, I think I encountered similar permission issues as the ones that Paul describes.&lt;p&gt;
So in short, I pretty much followed the steps which &lt;a href=&quot;http://blog.paulpounder.com/?p=27&quot; target=&quot;_blank&quot;&gt;Paul describes&lt;/a&gt; but with the difference of choosing the single server setup. I used the appropriate config settings:&lt;br&gt;
&lt;code&gt;
Config Directory: /Applications/MAMP/conf/apache
Server Binary: /Applications/MAMP/bin/apache2/bin/httpd 
Server Control Script: /Applications/MAMP/bin/apache2/bin/apachectl&lt;/code&gt;

I noticed that during an attempted multi-server install I was unable to get past this step and the installer crashed time and time again. I could blame my hosed Snow Leopard install for this, but I can&apos;t be sure what exactly caused this. A single server install seemed to work fine.&lt;br&gt;However as soon as I tried to hit localhost/cfide/administrator/index.cfm I was prompted to download the index.cfm file instead of the server actually trying to process it. I also added index.cfm to MAMP&apos;s httpd.conf file, but no luck. &lt;p&gt;
I remembered Paul&apos;s tip on permissions, and after a little digging I found the /Applications/ColdFusion9/runtime/lib/wsconfig.jar file (which sounded like the single server equivalent of the wsconfig.jar file Paul mentioned living in /Applications/JRun4/lib/ on his system).&lt;br&gt;
I launched the jar file (you may prefer to do this via the &apos;web server connector utility&apos; button from within the ColdFusionLauncher.app) and noticed that there were no configured web server listed here - strange I thought. Adding the same Apache details noted above did not work, so I knew it had to be a permissions issue. Since this is my local development machine and I&apos;m less concerned about security I simply gave everyone full 777 permissions on /Applications/ColdFusion9/runtime/lib/wsconfig and contained items. I then re-run the wsconfig.jar and bingo, the settings now seemed to stick.&lt;p&gt;
There was one last hickup when I tried to hit localhost/cfide/administrator/index.cfm again. For reasons unknown even to myself I simply omitted the /index.cfm and bingo yet again, the CF Admin wizard completed the install and CF9 was up and running. At this stage I probably should have reverted the permissions on wsconfig again... Maybe I&apos;ll do that later. 
&lt;p&gt;
Another tip: make sure you restart CF when you hit an apparent problem, sometimes that can clear things up too. I also found the system logs in OSX quite helpful, there was a problem with Apache&apos;s httpd.conf at some stage which showed up in the logs and was easily solved (some sort of unclosed tag).&lt;p&gt;
Something that I never managed to sort out with CF8 under Leopard was to stop and start CF via the ColdFusionLauncher app. But even that works now, so that&apos;s great. But just in case you need to start CF from the commandline, here&apos;s the command to do it:
&lt;code&gt;
/Applications/ColdFusion9/bin/coldfusion start
&lt;/code&gt;
Other options are stop and restart - you may also want to try this with sudo if it doesn;t work - it&apos;s what I always had to do in CF8 and Leopard.
&lt;p&gt;
So there you go. And after all that the install will probably run just fine for you :-)
				</description>
				
				<category>ColdFusion</category>
				
				<category>General</category>
				
				<pubDate>Mon, 02 Nov 2009 15:35:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2009/11/2/cf9-mamp-snowleopard</guid>
				
				
			</item>
			
			<item>
				<title>Tip for Debugging Remoting Calls in Flex Builder 3</title>
				<link>http://www.therealtimeweb.com/index.cfm/2009/8/21/tracetarget-flex</link>
				<description>
				
				Imagine the times when &lt;a href=&quot;http://labs.adobe.com/technologies/flashbuilder4/&quot; target=&quot;_blank&quot;&gt;Flash Builder&lt;/a&gt; (Gumbo) was still in beta, times when the &lt;a href=&quot;http://anirudhs.chaosnet.org/blog/2009.06.01.html&quot; target=&quot;_blank&quot;&gt;Network Monitor&lt;/a&gt; was still only a twinkle in the corner of a Flex engineer&apos;s eye. Imagine... your current day job, and a Flex 3 project with a bit of ColdFusion powered Remoting (other Remoting gateways are available) thrown in. Which is going wrong. And you need to debug the Remoting calls.&lt;br&gt;
Ok, that doesn&apos;t require much imagination, I know. We know that Flash Builder will make our lives somewhat easier when it finally ships, but in the meantime your boss doesn&apos;t allow you to run beta software so what does one do besides coming to work for me? And maybe, just maybe, your boss is really mean (unlike myself) and won&apos;t even pay out for a license of &lt;a href=&quot;http://www.charlesproxy.com/&quot; target=&quot;_blank&quot;&gt;Charles&lt;/a&gt;. So now what?&lt;p&gt; 
I present to you &lt;mx:TraceTarget/&gt;. It&apos;s a little tag tat does wonders to your Flex Builder 3 Console, and I don&apos;t know why it isn&apos;t being promoted much more. I&apos;ve been using it for quite a while, and while I do not recall how I discovered it I am sure it&apos;s never too late to tell the world all about it. &lt;p&gt;
So what does &lt;a href=&quot;http://livedocs.adobe.com/flex/3/langref/mx/logging/targets/TraceTarget.html&quot; target=&quot;_blank&quot;&gt;TraceTarget&lt;/a&gt; do? In a nutshell it outputs a ton of logging information into your Console when you debug your Flex project, and in particular it tells you a lot about the Remoting calls that you are undoubtedly making. Here&apos;s an example of my current project, first without TraceTarget added: &lt;br&gt;
&lt;code&gt;
[SWF] Users:stefan:Documents:dev:flex:fb3:demo:bin-debug:index.swf - 1,379,424 bytes after decompression
result getUserDetails
&lt;/code&gt;
Yeah, nothing basically besides one trace that I out in there to signal the return from CF. Now let&apos;s add &lt;mx:TraceTarget/&gt; to the main.mxml file and debug the app again:&lt;br&gt;
&lt;code&gt;
[SWF] Users:stefan:Documents:dev:flex:fb3:demo:bin-debug:index.swf - 1,383,632 bytes after decompression
&apos;9670B130-68C5-3D75-D251-3D30C4A99F2E&apos; producer set destination to &apos;ColdFusion&apos;.
&apos;F2AF48B3-896A-FA9D-D77A-3D30C4AF2A71&apos; producer set destination to &apos;ColdFusion&apos;.
&apos;8495032E-7DE7-49B1-124E-3D30C4EB0643&apos; producer set destination to &apos;ColdFusion&apos;.
&apos;8495032E-7DE7-49B1-124E-3D30C4EB0643&apos; producer sending message &apos;17E7B79A-6D4E-21C3-4F67-3D30C4EE538F&apos;
&apos;my-cfamf&apos; channel endpoint set to http://www.demo.com/flex2gateway/
&apos;my-cfamf&apos; channel settings are:
&lt;channel id=&quot;my-cfamf&quot; type=&quot;mx.messaging.channels.AMFChannel&quot;&gt;
  &lt;endpoint uri=&quot;http://www.demo.com/flex2gateway/&quot;/&gt;
  &lt;properties&gt;
    &lt;polling-enabled&gt;false&lt;/polling-enabled&gt;
  &lt;/properties&gt;
&lt;/channel&gt;
&apos;my-cfamf&apos; pinging endpoint.
&apos;my-cfamf&apos; channel is connected.
&apos;my-cfamf&apos; channel sending message:
(mx.messaging.messages::RemotingMessage)#0
  body = (Array)#1
    [0] &quot;abcd&quot;
  clientId = (null)
  destination = &quot;ColdFusion&quot;
  headers = (Object)#2
  messageId = &quot;17E7B79A-6D4E-21C3-4F67-3D30C4EE538F&quot;
  operation = &quot;getRoomDetails&quot;
  source = &quot;api.v1.private.rooms&quot;
  timestamp = 0
  timeToLive = 0
&apos;8495032E-7DE7-49B1-124E-3D30C4EB0643&apos; producer connected.
&apos;8495032E-7DE7-49B1-124E-3D30C4EB0643&apos; producer acknowledge of &apos;17E7B79A-6D4E-21C3-4F67-3D30C4EE538F&apos;.
1
&apos;9670B130-68C5-3D75-D251-3D30C4A99F2E&apos; producer sending message &apos;01B287E5-5EF5-1B40-75EE-3D30C648A026&apos;
&apos;9670B130-68C5-3D75-D251-3D30C4A99F2E&apos; producer connected.
&apos;my-cfamf&apos; channel sending message:
(mx.messaging.messages::RemotingMessage)#0
  body = (Array)#1
  clientId = (null)
  destination = &quot;ColdFusion&quot;
  headers = (Object)#2
  messageId = &quot;01B287E5-5EF5-1B40-75EE-3D30C648A026&quot;
  operation = &quot;getUserDetails&quot;
  source = &quot;api.v1.private.users&quot;
  timestamp = 0
  timeToLive = 0
&apos;9670B130-68C5-3D75-D251-3D30C4A99F2E&apos; producer acknowledge of &apos;01B287E5-5EF5-1B40-75EE-3D30C648A026&apos;.
result getUserDetails
&lt;/code&gt;
&lt;br&gt;
Pretty cool, right? You can read more about TraceTarget and other &lt;a href=&quot;http://blog.sbistram.de/2008/12/12/flex-using-the-flex3-logging-api/&quot; target=&quot;_blank&quot;&gt;logging frameworks here&lt;/a&gt;. But if you just want a quick and dirty way to see some more debug info on your Remoting calls then you could do worse than simply sticking the TraceTarget tag into your main.mxml file and save yourself some hassle. It may not be as slick as Charles or the upcoming Network Monitor but it can be handy nevertheless. Have fun coding.
				</description>
				
				<category>Flex</category>
				
				<category>ColdFusion</category>
				
				<category>Tools</category>
				
				<pubDate>Fri, 21 Aug 2009 16:27:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2009/8/21/tracetarget-flex</guid>
				
				
			</item>
			
			<item>
				<title>Flex and ColdFusion Connection Tester</title>
				<link>http://www.therealtimeweb.com/index.cfm/2008/7/16/flex-cf-connectivity</link>
				<description>
				
				My friend &lt;a href=&quot;http://www.nutrixinteractive.com/blog/?p=129&quot; target=&quot;_blank&quot;&gt;Simon&lt;/a&gt; has just released a neat little Flex application that allows you to test and troubleshoot a simple RemoteObject connection between Flex and CF. It&apos;s mainly aimed at people who are new to Flex (or CF) but it will undoubtedly also come in handy for more experienced developers. In fact I think this would also make a great little AIR application.&lt;br&gt;
Sources are provided and you can find all the &lt;a href=&quot;http://www.nutrixinteractive.com/blog/?p=129&quot; target=&quot;_blank&quot;&gt;necessary information here&lt;/a&gt;.
				</description>
				
				<category>Flex</category>
				
				<category>ColdFusion</category>
				
				<category>Applications</category>
				
				<pubDate>Wed, 16 Jul 2008 14:15:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2008/7/16/flex-cf-connectivity</guid>
				
				
			</item>
			
			<item>
				<title>How To Put a User Into a CF Session via FMS?</title>
				<link>http://www.therealtimeweb.com/index.cfm/2007/7/23/CF-Session-via-FMS</link>
				<description>
				
				I&apos;ve got a problem. I&apos;m working on a chat app which uses Flex, Coldfusion and FMS to log a user into the application. Here&apos;s what happens: User enters text into login form in Flex, Flex tries to connect to FMS, FMS authenticates the user via CF and Remoting and grants or denies access to the application by either accepting or rejecting the connection. So far so good, this works. &lt;br&gt;
My problem is that I do not understand how I can &apos;hold on&apos; to the user&apos;s session in CF so that further requests which come directly from the client (Flex &gt; CF) can be controlled so that only users which have previously authenticated via FMS &gt; CF are allowed to access CF&apos;s functions (such as requesting user details, sending an invite to another user and so on). 
&lt;br&gt;
I guess my question is this: how can I put a user into a CF session when my authentication happens outside of the browser via FMS? And if I can do this, how can I control session expiration (chat sessions may last hours)?&lt;p&gt;
Thanks for any advice.
				</description>
				
				<category>FMS</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Mon, 23 Jul 2007 17:37:00 +0100</pubDate>
				<guid>http://www.therealtimeweb.com/index.cfm/2007/7/23/CF-Session-via-FMS</guid>
				
				
			</item>
			</channel></rss>