<?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"
	>

<channel>
	<title>gregs</title>
	<atom:link href="http://gregs.tcias.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregs.tcias.co.uk</link>
	<description>helping me remember what I figure out</description>
	<pubDate>Thu, 07 Aug 2008 05:28:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>I took it</title>
		<link>http://gregs.tcias.co.uk/2008/07/30/i-took-it/</link>
		<comments>http://gregs.tcias.co.uk/2008/07/30/i-took-it/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 05:07:40 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[about]]></category>

		<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=471</guid>
		<description><![CDATA[
Now you should too!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://alistapart.com/articles/survey2008"><img title="i-took-the-2008-survey" src="http://gregs.tcias.co.uk/wp-content/uploads/2008/07/i-took-the-2008-survey.gif" alt="I took the 2008 survey" width="180" height="46" /></a></p>
<p>Now you should too!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/07/30/i-took-it/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VMWare and keyboard input</title>
		<link>http://gregs.tcias.co.uk/2008/07/09/vmware-and-keyboard-input/</link>
		<comments>http://gregs.tcias.co.uk/2008/07/09/vmware-and-keyboard-input/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 01:07:03 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[*nix]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[os x]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=470</guid>
		<description><![CDATA[This morning I fired my Windows XP VM on my mac and my keyboard input simply stopped working. After a couple of VM reboots, which had no effect, I did some googling. The first result suggested typing a few commands to determine what had disabled it:
PLAIN TEXT
CODE:




$ ioreg -l -w 0 &#124; grep SecureInput


&#124;&#160; &#160;"IOConsoleUsers" [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I fired my Windows XP VM on my mac and my keyboard input simply stopped working. After a couple of VM reboots, which had no effect, I did some googling. <a title="keyboard stops working... system beeps" href="http://communities.vmware.com/message/617423">The first result</a> suggested typing a few commands to determine what had disabled it:</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ ioreg -l -w <span style="color:#800000;color:#800000;">0</span> | grep SecureInput</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;<span style="color:#CC0000;">"IOConsoleUsers"</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#CC0000;">"kCGSSessionSecureInputPID"</span>=<span style="color:#800000;color:#800000;">177</span>,<span style="color:#CC0000;">"kCGSSessionLoginwindowSafeLogin"</span>=No,<span style="color:#CC0000;">"kCGSSessionAuditIDKey"</span>=<span style="color:#800000;color:#800000;">0</span>,<span style="color:#CC0000;">"kCGSessionLoginDoneKey"</span>=Yes,<span style="color:#CC0000;">"kCGSSessionSystemSafeBoot"</span>=No,<span style="color:#CC0000;">"kCGSSessionOnConsoleKey"</span>=Yes,<span style="color:#CC0000;">"kCGSSessionUserIDKey"</span>=<span style="color:#800000;color:#800000;">501</span>,<span style="color:#CC0000;">"kSCSecuritySessionID"</span>=<span style="color:#800000;color:#800000;">11622192</span>,<span style="color:#CC0000;">"kCGSSessionUserNameKey"</span>=<span style="color:#CC0000;">"gregstewart"</span>,<span style="color:#CC0000;">"kCGSSessionGroupIDKey"</span>=<span style="color:#800000;color:#800000;">20</span>,<span style="color:#CC0000;">"kCGSSessionConsoleSetKey"</span>=<span style="color:#800000;color:#800000;">0</span>,<span style="color:#CC0000;">"kCGSSessionIDKey"</span>=<span style="color:#800000;color:#800000;">256</span>,<span style="color:#CC0000;">"kCGSessionLongUserNameKey"</span>=<span style="color:#CC0000;">"User"</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ ps auxwwww | grep <span style="color:#800000;color:#800000;">177</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">user <span style="color:#800000;color:#800000;">177</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">7</span>.<span style="color:#800000;color:#800000;">8</span>&nbsp; <span style="color:#800000;color:#800000;">9</span>.<span style="color:#800000;color:#800000;">2</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">652520</span> <span style="color:#800000;color:#800000;">192788</span>&nbsp; &nbsp;??&nbsp; S&nbsp; &nbsp; <span style="color:#800000;color:#800000;">10</span>:51pm&nbsp; <span style="color:#800000;color:#800000;">59</span>:<span style="color:#800000;color:#800000;">09</span>.<span style="color:#800000;color:#800000;">22</span> /Applications/Firefox.<span style="">app</span>/Contents/MacOS/firefox-bin -psn_0_110619</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">user <span style="color:#800000;color:#800000;">1155</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">599820</span>&nbsp; &nbsp; <span style="color:#800000;color:#800000;">464</span> s001&nbsp; S+&nbsp; &nbsp;<span style="color:#800000;color:#800000;">10</span>:44am&nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span>.<span style="color:#800000;color:#800000;">00</span> grep <span style="color:#800000;color:#800000;">177</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>According to the post the application that was blocking it was FireFox. "kCGSSessionSecureInputPID"=177 is the info you need to look for, where in my case 177 was the number I needed to use in the next command. Incredulous as I was, I closed FireFox and hey presto keyboard input was working again.</p>
<p>Hopefully this post will help others.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/07/09/vmware-and-keyboard-input/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX calls and expired sessions</title>
		<link>http://gregs.tcias.co.uk/2008/06/19/ajax-calls-and-expired-sessions/</link>
		<comments>http://gregs.tcias.co.uk/2008/06/19/ajax-calls-and-expired-sessions/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 08:12:44 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[ColdFusion]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gregs.teacupinastorm.com/?p=477</guid>
		<description><![CDATA[I have been updating a bunch of code recently to make use of the new features in Prototype 1.6 and one of the great additions in this release was the introduction of Automatic JavaScript response evaluation. This allowed me to improve on my session checking code without having to fuff around with the response information [...]]]></description>
			<content:encoded><![CDATA[<p>I have been updating a bunch of code recently to make use of the new features in <a href="http://prototypejs.org/">Prototype 1.6</a> and one of the great additions in this release was the introduction of <a href="http://prototypejs.org/api/ajax/request">Automatic JavaScript response evaluation</a>. This allowed me to improve on my session checking code without having to fuff around with the response information sent back to the client. The problem was with XHR requests: i.e. if the user initiated such a request when his session had expired, then usually the response would fail or worse just hang.</p>
<p>The snippet below shows my new session checking code.</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showPlainTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span>&gt;&lt;!--</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> myAjaxCall<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;url = <span style="color: #3366CC;">"index.cfm"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;pars=<span style="color: #3366CC;">"?fuseaction.someFuseaction&amp;par1=1&amp;par2=2"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #006600;">Updater</span><span style="color: #66cc66;">&#40;</span>\\<span style="color: #3366CC;">'div_to_populate<span style="color: #000099; font-weight: bold;">\\</span>'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;url, <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;method: \\<span style="color: #3366CC;">'post<span style="color: #000099; font-weight: bold;">\\</span>'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;postBody: pars,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;onLoading: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">//code to run while making the request</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;onComplete : <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>transport,json<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>json &amp;&amp; json<span style="color: #66cc66;">&#91;</span>\\<span style="color: #3366CC;">'session<span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;setSessionExpired<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//Code to run when the request has completed</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;onFailure: <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>\\<span style="color: #3366CC;">'something went wrong<span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; evalScripts:<span style="color: #003366; font-weight: bold;">true</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> setSessionExpired<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;<span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>\\<span style="color: #3366CC;">'Your session has timed out<span style="color: #000099; font-weight: bold;">\\</span>'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;window.<span style="color: #006600;">location</span>=\\<span style="color: #3366CC;">'http://&lt;cfoutput&gt;#cgi.HTTP_HOST#&lt;/cfoutput&gt;/?fuseaction=home.home<span style="color: #000099; font-weight: bold;">\\</span>'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --&gt;&lt;/script&gt; </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The trick is to intercept the call when you do your session checking at the back end. Let's say you have a fuseaction called login.login (see below and yes this is fusebox 3 :S) where you display the login form when a user is not logged in, this is where I inserted the check for an XHR request, by looking at the http headers sent along with the request. The key here is a new header attribute passed in with Prototype "X-Requested-With". If this attribute exists then I know it's an XHR request and I can create a custom JSON header with an error struct that holds a key called session with a value of timeout. All I then need to do is encode the struct as JSON and pass that encoded struct back to the browser.</p>
<div class="igBar"><span id="lcode-7"><a href="#" onclick="javascript:showPlainTxt('code-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-7">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;cfcase value=<span style="color:#CC0000;">"login"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--- gvs 1Feb08 - handles XHR requests that session timeout ---&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfset attributes.<span style="">request</span> = GetHttpRequestData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfif StructKeyExists<span style="color:#006600; font-weight:bold;">&#40;</span>attributes.<span style="">request</span>.<span style="">headers</span>,<span style="color:#CC0000;">"X-Requested-With"</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfsetting showdebugoutput=<span style="color:#CC0000;">"false"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfparam name=<span style="color:#CC0000;">"attributes.jsonObj"</span> default=<span style="color:#CC0000;">"#CreateObject('component','com.jehiah.json')#"</span>/&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfparam name=<span style="color:#CC0000;">"error"</span> default=<span style="color:#CC0000;">"#StructNew()#"</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfset error<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'session'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#CC0000;">'timeout'</span>/&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfif StructKeyExists<span style="color:#006600; font-weight:bold;">&#40;</span>attributes,<span style="color:#CC0000;">"jsonObj"</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfheader name=<span style="color:#CC0000;">"X-JSON"</span> value=<span style="color:#CC0000;">"#trim(attributes.jsonObj.encode(error))#"</span> /&gt;&lt;cfabort&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/cfif&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/cfif&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfif StructKeyExists<span style="color:#006600; font-weight:bold;">&#40;</span>session,<span style="color:#CC0000;">'login'</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfset attributes.<span style="">login</span> = session.<span style="">login</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfelse&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cfparam name=<span style="color:#CC0000;">"attributes.login"</span> default=<span style="color:#CC0000;">""</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/cfif&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfscript&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xfa.<span style="">submitform</span>=<span style="color:#CC0000;">'index.cfm?fuseaction=login.processlogin'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/cfscript&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;cfinclude template=<span style="color:#CC0000;">"#affiliate('dsp_login.cfm')#"</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/cfcase&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now let's jump back to the JavaScript code and take a look at the onComplete function again:</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showPlainTxt('javascript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">onComplete : <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>transport,json<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>json &amp;amp;&amp;amp; json<span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">'session'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setSessionExpired<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//Code to run when the request has completed</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If there's a JSON object and it has a key of session then I call my setSessionExpired function which redirects the users. Now the json session key only exists in these situations since the call normally just passes back the result of the call.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/06/19/ajax-calls-and-expired-sessions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Goosh</title>
		<link>http://gregs.tcias.co.uk/2008/06/03/goosh/</link>
		<comments>http://gregs.tcias.co.uk/2008/06/03/goosh/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 01:43:15 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[*nix]]></category>

		<category><![CDATA[browser]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=469</guid>
		<description><![CDATA[The unofficial Google Shell... I like it!
]]></description>
			<content:encoded><![CDATA[<p><a title="The unofficial Google shell" href="http://goosh.org/">The unofficial Google Shell</a>... I like it!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/06/03/goosh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reflow</title>
		<link>http://gregs.tcias.co.uk/2008/05/30/reflow/</link>
		<comments>http://gregs.tcias.co.uk/2008/05/30/reflow/#comments</comments>
		<pubDate>Fri, 30 May 2008 04:27:42 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[browser]]></category>

		<category><![CDATA[rendering]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=468</guid>
		<description><![CDATA[Or more appropriately what is it? Fascinating...
]]></description>
			<content:encoded><![CDATA[<p>Or more appropriately <a title="What is reflow" href="http://dougt.wordpress.com/2008/05/24/what-is-a-reflow/">what is it</a>? Fascinating...</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/05/30/reflow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IIS virtualhosts and SSL</title>
		<link>http://gregs.tcias.co.uk/2008/05/21/iis-virtualhosts-and-ssl/</link>
		<comments>http://gregs.tcias.co.uk/2008/05/21/iis-virtualhosts-and-ssl/#comments</comments>
		<pubDate>Wed, 21 May 2008 05:09:04 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[iis]]></category>

		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=467</guid>
		<description><![CDATA[For posterity, if you are configuring several websites, that use the same IP/port combination for SSL and you are using host headers to identify them, then you'll need to follow these steps, particularly this one here. Always strikes me as odd that when you basically have everything in a GUI, for the final step you [...]]]></description>
			<content:encoded><![CDATA[<p>For posterity, if you are configuring several websites, that use the same IP/port combination for SSL and you are using host headers to identify them, then you'll need to<a title="Configuring SSL Host Headers (IIS 6.0)" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/596b9108-b1a7-494d-885d-f8941b07554c.mspx?mfr=true"> follow these steps</a>, particularly <a title="Configuring Server Bindings for SSL Host Headers (IIS 6.0)" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/596b9108-b1a7-494d-885d-f8941b07554c.mspx?mfr=true">this one here</a>. Always strikes me as odd that when you basically have everything in a GUI, for the final step you have to crak open the command line. Especially when you consider that you don't need to do anything for multiple hosts on port 80.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/05/21/iis-virtualhosts-and-ssl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Embedded images an IE work around</title>
		<link>http://gregs.tcias.co.uk/2008/05/18/embedded-images-an-ie-work-around/</link>
		<comments>http://gregs.tcias.co.uk/2008/05/18/embedded-images-an-ie-work-around/#comments</comments>
		<pubDate>Mon, 19 May 2008 02:13:04 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://gregs.tcias.co.uk/?p=466</guid>
		<description><![CDATA[A while back I posted about using the data:image/jpeg;base64 to directly embed the image in to the source attribute of an image tag, however this did not work with IE. Today I stumbled across this JavasScript solution. Certainly an option, though in my case it was overkill, however I thought others might find it useful.
]]></description>
			<content:encoded><![CDATA[<p>A while back <a title="Embedded image" href="http://gregs.tcias.co.uk/2007/03/13/embedded-image/">I posted</a> about using the <em>data:image/jpeg;base64</em> to directly embed the image in to the source attribute of an image tag, however this did not work with IE. Today <a title="jsimgs: embedded images in web pages - php encoder" href="http://ddzoom.net/jsimages/out.htm">I stumbled across</a> this JavasScript solution. Certainly an option, though in my case it was overkill, however I thought others might find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/05/18/embedded-images-an-ie-work-around/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Restricting FTP passive ports</title>
		<link>http://gregs.tcias.co.uk/2008/01/10/restricting-ftp-passive-ports/</link>
		<comments>http://gregs.tcias.co.uk/2008/01/10/restricting-ftp-passive-ports/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 07:18:16 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://gregs.teacupinastorm.com/2008/01/10/restricting-ftp-passive-ports/</guid>
		<description><![CDATA[After a full day of messages going backwards and forwards between myself and our firewall admins, here's a gem of a post with a script to restrict the port range used by passive FTP on Windows 2003 server (as well as telling Windows Firewall to leave those ports open). Who would have thought securing FTP [...]]]></description>
			<content:encoded><![CDATA[<p>After a full day of messages going backwards and forwards between myself and our firewall admins, here's a <a title="Configuring Windows 2003 Firewall and IIS 6 for pasv ftp port range" href="http://clintm.esria.com/2006/11/20/configuring-windows-2003-firewall-and-iis-6-for-pasv-ftp-port-range/">gem of a post</a> with a script to restrict the port range used by passive FTP on Windows 2003 server (as well as telling Windows Firewall to leave those ports open). Who would have thought securing FTP would be so involved...</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/01/10/restricting-ftp-passive-ports/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bad Network Solutions, bad</title>
		<link>http://gregs.tcias.co.uk/2008/01/09/bad-network-solutions-bad/</link>
		<comments>http://gregs.tcias.co.uk/2008/01/09/bad-network-solutions-bad/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 07:26:00 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://gregs.teacupinastorm.com/2008/01/09/bad-network-solutions-bad/</guid>
		<description><![CDATA[Courtesy of Slashdot, news that Network Solutions are front running domain names. I don't care much for their response that this is to protect us, the customer, from evil do-ers. Especially when they charge a premium ($34.99) for their domain names, whereas services like Go Daddy offer them for $9.99. Way to go Network Solutions!!
]]></description>
			<content:encoded><![CDATA[<p>Courtesy of <a title="NSI Registers Every Domain Checked" href="http://slashdot.org/article.pl?sid=08/01/08/1920215">Slashdot</a>, news that Network Solutions are front running domain names. I don't care much for <a title="Network Solutions Responds to Front Running Accusations" href="http://www.circleid.com/posts/81082_network_solutions_front_running/">their response</a> that this is to protect us, the customer, from evil do-ers. Especially when they charge a <a title="Domain Pricing Chart" href="http://www.networksolutions.com/domain-name-registration/pricing-chart.jsp">premium</a> ($34.99) for their domain names, whereas services like <a href="http://www.godaddy.com/gdshop/default.asp">Go Daddy</a> offer them for $9.99. Way to go Network Solutions!!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/01/09/bad-network-solutions-bad/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy New Year&#8230;</title>
		<link>http://gregs.tcias.co.uk/2008/01/04/happy-new-year/</link>
		<comments>http://gregs.tcias.co.uk/2008/01/04/happy-new-year/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 03:46:44 +0000</pubDate>
		<dc:creator>gregs</dc:creator>
		
		<category><![CDATA[linode]]></category>

		<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://gregs.teacupinastorm.com/2008/01/04/happy-new-year/</guid>
		<description><![CDATA[... to one and all.
New year, new look, search engine friendly URLs, fresh apache 2 install, ditto for MySQL. Add to that an additional 20% of RAM (thank you Linode!!), all in all a good start to the new year, promises to be a good one. 
]]></description>
			<content:encoded><![CDATA[<p>... to one and all.</p>
<p>New year, new look, search engine friendly URLs, fresh apache 2 install, ditto for MySQL. Add to that an additional 20% of RAM (thank you <a title="Linode.com" href="http://www.linode.com/">Linode</a>!!), all in all a good start to the new year, promises to be a good one. <img src='http://gregs.tcias.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://gregs.tcias.co.uk/2008/01/04/happy-new-year/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
