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

<channel>
	<title>Krues8dr.com</title>
	<atom:link href="http://www.krues8dr.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.krues8dr.com</link>
	<description>Personal website and programming notes of Bill Hunt</description>
	<pubDate>Tue, 06 Jul 2010 00:08:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Defensive Programming</title>
		<link>http://www.krues8dr.com/2010/04/09/defensive-programming/</link>
		<comments>http://www.krues8dr.com/2010/04/09/defensive-programming/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 19:51:42 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

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

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=79</guid>
		<description><![CDATA[As a web developer, the greater part of my job is not creating new apps, but hacking together disparate software packages into Frankensteinian amalgamations that (supposedly) work together seamlessly.  This is universally a headache, as the original authors tend to write code thinking that their app is the only one that will be installed.  Wordpress, Vanilla, [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer, the greater part of my job is not creating new apps, but hacking together disparate software packages into Frankensteinian amalgamations that (supposedly) work together seamlessly.  This is universally a headache, as the original authors tend to write code thinking that their app is the only one that will be installed.  <a href="http://wordpress.org">Wordpress</a>, <a href="http://vanillaforums.org/">Vanilla</a>, and <a href="http://www.interspire.com/emailmarketer/">Interspire&#8217;s Email Marketer</a> are some of the worst offenders that I  struggle with regularly.</p>
<p>When coding your own brilliant application, there are a few simple things you can do to avoid potential collisions and headaches later, especially if anyone else will be using your code.  Here are a few areas to pay attention to.<span id="more-79"></span></p>
<h3>Namespace</h3>
<p>First and foremost, you need to watch out for collisions.  If you&#8217;re not using a language with built-in namespacing (e.g. PHP &lt;5.3), you&#8217;ll need to manage this manually. Some areas that you need to watch out for are:</p>
<ul>
<li>Class Names</li>
<li>Session Variables</li>
<li>Local Variables</li>
<li>Constants &amp; Globals</li>
<li>Database Tables</li>
</ul>
<p>Most databases already have a &#8220;users&#8221; table somewhere, and an app of any  size is likely to have a variable named &#8220;args&#8221; or &#8220;params&#8221; (or two, or  ten&#8230;). For most cases, it&#8217;s usually enough to prefix your names with your application name.  Keeping your names verbose helps, too.</p>
<h3>Program Flow</h3>
<p>When writing code, it&#8217;s always a good idea to keep everything to small, reusable functions.  This is especially true of published apps, because your users are very likely to be using your code in ways that your original app is not.  Try to break things down to the smallest possible chunks, even if it looks pedantic in your application.  For instance, break up your createUser() function into separate functions to add the user to the user table, subscribing the user to an email list, adding the user to the default group, etc.</p>
<p>Assume that your code will be executing inside of someone else&#8217;s code.  Try not to use print and echo statements when you can simply pass returned values - only print as the final step.  (An easy way to fake this is to use output buffering.)  You never know where your output is going anyway - so don&#8217;t assume that it will be a particular format - it may end up as HTML, an email body, or in the error log depending on how it&#8217;s implemented.</p>
<p>Pay special attention to any implicit defaults or rules that your code expects.  Don&#8217;t force the code to expect complicated series of objects or parameters that any one else wouldn&#8217;t immediately understand.  Don&#8217;t rely on database restrictions to impose your business rules.</p>
<p>Assume that your code will be glued into an existing user system at some point - make your user system as user-friendly as possible.  Create big wide hooks that anyone can use later to interact with your user system.  Actually, do this for everything.  (Ok, Wordpress, you got that one right at least.)</p>
<p>Keep things wrapped up in nice containers.  Don&#8217;t just leave large procedural chunks lying around for others to trip over.  Don&#8217;t forget to give some attention to your configuration files on this front.</p>
<p><strong>Don&#8217;t use globals.  Don&#8217;t use globals.  For the love of God, don&#8217;t use globals.  I don&#8217;t care how clever you think you are (I&#8217;m looking at you, <a href="http://wordpress.org">Wordpress</a>), you&#8217;re going to screw everyone else up if you use globals.</strong></p>
<h3>Don&#8217;t Step On Toes</h3>
<p>When you&#8217;re managing your resources, it&#8217;s a good idea to be courteous of others.  If you&#8217;re using a database connection or local file, keep a copy of the handle around instead of relying on the implicit &#8220;last opened&#8221; scheme many languages offer.  And since you&#8217;re all such brilliant developers, I don&#8217;t have to remind you to make sure to clean up after yourself - closing any connections that you opened, deleting any temporary files you&#8217;ve created, and cleaning up any objects you&#8217;re done using.  Even better, write error handling into all of your code so these things are done automatically even if something fails!</p>
<p>One particularly abused area is Session/Cookie management.  I cannot begin to list the number of applications that hijack the session and fill/clear it wantonly.  In general, you should never be destroying a session, or blanking out the entire cookie.  Always sandbox off your content into a hash (using namespaces again), so that you can remove only the content you added.  Also, don&#8217;t ever set the session name directly - just use the default.  (At least, in PHP you can&#8217;t use two different sessions simultaneously - setting the session name removes the ability to use any other session).</p>
<h3>In conclusion&#8230;</h3>
<p>Do be a considerate programmer.  Do keep good fences (as they make for good neighbors).  Don&#8217;t build giant monoliths (as they attract groups of violent monkeys).  Stick to these rules and you&#8217;ll save everyone a lot of trouble in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2010/04/09/defensive-programming/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scriptaculous / Prototype IE 8 Autocomplete disappearing problem</title>
		<link>http://www.krues8dr.com/2009/10/30/scriptaculous-prototype-ie-8-autocomplete-disappearing-problem/</link>
		<comments>http://www.krues8dr.com/2009/10/30/scriptaculous-prototype-ie-8-autocomplete-disappearing-problem/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 19:29:55 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=68</guid>
		<description><![CDATA[In Internet Explorer 8, it seems that Scriptaculous / Prototype sometimes miscalculate exactly where to place the autocomplete box.  As a result, it will usually not show up at all, since it&#8217;s off the screen.  The trick here is that it&#8217;s calculating a left and top absolute position that are wrong, and then [...]]]></description>
			<content:encoded><![CDATA[<p>In <strong>Internet Explorer 8</strong>, it seems that <strong>Scriptaculous</strong> / <strong>Prototype</strong> sometimes miscalculate exactly where to place the <strong>autocomplete box</strong>.  As a result, it will usually <strong>not show up at all</strong>, since it&#8217;s off the screen.  The trick here is that it&#8217;s calculating a left and top absolute position that are wrong, and then writing them directly to the element as inline styles.  </p>
<p>The solution, though a bit of a hack, is to write styles for the div container that use the <strong>!important rule</strong>, which will override any inline styles.  Here&#8217;s what the fix should look like:</p>
<p><code><br />
#my_auto_complete {<br />
    position: relative !important;<br />
    top: -10px !important;<br />
    left: 0px !important;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/10/30/scriptaculous-prototype-ie-8-autocomplete-disappearing-problem/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS: Spriting Doors</title>
		<link>http://www.krues8dr.com/2009/08/11/css-spriting-doors/</link>
		<comments>http://www.krues8dr.com/2009/08/11/css-spriting-doors/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 13:38:49 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

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

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=57</guid>
		<description><![CDATA[When we redesigned hotelicopter, I had to spend a lot of time cutting up images for a bunch of buttons and boxes.  I was using the now-standard Sliding Doors technique, so that we could have flexible boxes.  Today, I realized that I could combine this technique with another A List Apart favorite, image [...]]]></description>
			<content:encoded><![CDATA[<p>When we redesigned <a href="http://hotelicopter.com">hotelicopter</a>, I had to spend a lot of time cutting up images for a bunch of buttons and boxes.  I was using the now-standard <a href="http://www.alistapart.com/articles/slidingdoors/">Sliding Doors</a> technique, so that we could have flexible boxes.  Today, I realized that I could combine this technique with another <a href="http://www.alistapart.com/">A List Apart</a> favorite, <a href="http://www.alistapart.com/articles/sprites">image sprites</a>, so that you can have sliding doors <strong>using only one image</strong>.  <span id="more-57"></span></p>
<p>Effectively, you create your a background image the maximum width that you expect the box to be, as you would do with <strong>sliding doors</strong>.  However, instead of cutting off the left side (or right side, as you prefer), you keep the image intact. Instead, you simply align the image to the left on the outside and the right on the inside, leaving enough padding for the image edges to show through.</p>
<p><img src="http://www.krues8dr.com/wp-content/uploads/2009/08/spritingdoors1.png" alt="spritingdoors1" title="spritingdoors1" width="170" height="71" /></p>
<p><a href="http://www.krues8dr.com/files/spriting_doors/">Here&#8217;s an example of the technique in action.</a><br />
Update: Example now works in FF3, FF3.5, IE7, IE8 and Safari 3 and 4!</p>
<p>The only caveat here is that this won&#8217;t work for images with transparency, and only saves you one download (ostensibly).  This technique could be expanded, however, to have the hover states of the button in the image as well (as in the sprites technique), or for all four pieces of the image, used in <strong>rounded corners</strong> and <strong>custom border</strong> styles.  I wouldn&#8217;t recommend either of those for particularly large boxes, though, as you&#8217;d need a really large image for those, which doesn&#8217;t optimize well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/08/11/css-spriting-doors/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Symfony + Doctrine on the command line using the wrong database</title>
		<link>http://www.krues8dr.com/2009/06/16/symfony-doctrine-on-the-command-line-using-the-wrong-database/</link>
		<comments>http://www.krues8dr.com/2009/06/16/symfony-doctrine-on-the-command-line-using-the-wrong-database/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 14:16:34 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=52</guid>
		<description><![CDATA[So, one us pilots was trying to use Doctrine migrations to update a database on one of our servers.  However, Doctrine was sternly refusing to use the correct database, as configured in the database.yml file.  As it turns out, using Symfony from the command line skips the usual route through the /web/yourapplication.php file [...]]]></description>
			<content:encoded><![CDATA[<p>So, one us <a href="http://www.hotelicopter.com/team">pilots</a> was trying to use <strong>Doctrine migrations</strong> to update a database on one of our servers.  However, Doctrine was sternly refusing to use the correct database, as configured in the <strong><code>database.yml</code></strong> file.  As it turns out, using <strong>Symfony</strong> from the command line skips the usual route through the <code>/web/yourapplication.php</code> file (e.g. <code>backend.php</code> or <code>frontend.php</code>).  As a result, the environment is not properly set when reading the <code>database.yml</code> file, and instead the last database connection specified is used.  Lame.  The trick is to specify the environment from the command line, so this file (and the other config files) do what they&#8217;re supposed to:</p>
<p><code><br />
symfony doctrine:migrate --env=staging frontend 119<br />
</code></p>
<p>where &#8220;staging&#8221; is whatever the environment is you want to use (to match the name in the <code>database.yml</code> file).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/06/16/symfony-doctrine-on-the-command-line-using-the-wrong-database/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Symfony / Doctrine - update a record using models</title>
		<link>http://www.krues8dr.com/2009/06/09/symfony-doctrine-update-a-record-using-models/</link>
		<comments>http://www.krues8dr.com/2009/06/09/symfony-doctrine-update-a-record-using-models/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 18:20:16 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

		<guid isPermaLink="false">http://www.krues8dr.com/?p=50</guid>
		<description><![CDATA[The Doctrine manual is really, really confusing in places.  If you want to do something as simple as updating a record, the examples suggest that you use Doctrine_Query::create().  This doesn&#8217;t make a lot of sense, because we only want to manipulate the model, we shouldn&#8217;t have to even look at a query.  [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.doctrine-project.org/documentation/manual/1_1/en" title="Doctrine ORM">Doctrine manual</a> is really, really confusing in places.  If you want to do something as simple as updating a record, the examples suggest that you use <code>Doctrine_Query::create()</code>.  This doesn&#8217;t make a lot of sense, because we only want to manipulate the model, we shouldn&#8217;t have to even look at a query.<span id="more-50"></span>  Assuming you have the primary id of the record in question, you can do the following to easily modify a record:</p>
<p><code><br />
$myobj = new Doctrine::getTable('MyObj')->find($request->getParameter('my_id'));<br />
$myobj->property = 'New Value';<br />
$myobj->save();<br />
</code></p>
<p>This is really straightforward, but if you don&#8217;t include the <code>find()</code> inline with the <code>getTable()</code> call, you&#8217;ll get an obscure <strong>&#8220;Unknown method saveTableProxy&#8221;</strong> error, which there seems to be no documentation for anywhere on the internet.  It only took a couple of hours of trial and error to get this figured out.  </p>
<p>In general, I&#8217;d still recommend Doctrine as an ORM, but the lack of consistent and clear documentation, with dreadfully obscure object methods, make for a very steep learning curve.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/06/09/symfony-doctrine-update-a-record-using-models/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP SimpleTest Unit Testing - Expecting Exceptions and Errors</title>
		<link>http://www.krues8dr.com/2009/06/01/php-simpletest-unit-testing-expecting-exceptions-and-errors/</link>
		<comments>http://www.krues8dr.com/2009/06/01/php-simpletest-unit-testing-expecting-exceptions-and-errors/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 21:12:03 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=46</guid>
		<description><![CDATA[Like a good programmer, I try to be good about unit testing.  And also as a good programmer, I throw errors in my PHP where appropriate.  I just learned today after a bit of digging through the codebase, that SimpleTest can be told to expect an Exception (or error) to be thrown in [...]]]></description>
			<content:encoded><![CDATA[<p>Like a good programmer, I try to be good about unit testing.  And also as a good programmer, I throw errors in my PHP where appropriate.  I just learned today after a bit of digging through the codebase, that <a title="SimpleTest from lastcraft" href="http://www.lastcraft.com/simple_test.php">SimpleTest</a> can be told to expect an Exception (or error) to be thrown in the test. <span id="more-46"></span></p>
<p>When using <code>trigger_error()</code>, you can use the <code>expectError()</code> as follows:<br />
<code><br />
	$this->expectError( $errorMessageToExpect, 'My message about this test case' );<br />
	my_code_that_causes_an_error();<br />
</code></p>
<p>Note that there is an internal <strong>queue of errors</strong> in SimpleTest, so it will expect precisely one error for each call to <code>expectError()</code>.  </p>
<p>If, however, you&#8217;re using <code>throw</code> you use <code>expectException</code> instead:<br />
<code><br />
	$this->expectException( $exceptionclass, 'My message about this test case' );<br />
	my_code_that_throws_an_exception_of_type_exceptionclass();<br />
</code></p>
<p>You can specify the class of exception to expect in the first parameter - the usual type would be <code>Exception</code>, of course.  If you set the first parameter to <code>false</code>, it defaults to this type.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/06/01/php-simpletest-unit-testing-expecting-exceptions-and-errors/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix for Adium Not Working with MSN Messenger Bug</title>
		<link>http://www.krues8dr.com/2009/03/24/fix-for-adium-not-working-with-msn-messenger-bug/</link>
		<comments>http://www.krues8dr.com/2009/03/24/fix-for-adium-not-working-with-msn-messenger-bug/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 19:32:33 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

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

		<guid isPermaLink="false">http://www.krues8dr.com/?p=42</guid>
		<description><![CDATA[For the last few months, I haven&#8217;t been able to use MSN Messenger with Adium.  I&#8217;d log in, but it would just hang endlessly.  Searching the bug reports was frustrating, and didn&#8217;t provide any insights.  Today I found this obscure post which gives the solution.  Apparently M$N changed the default connection [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few months, I haven&#8217;t been able to use <strong>MSN Messenger</strong> with <strong>Adium</strong>.  I&#8217;d log in, but it would just hang endlessly.  Searching the bug reports was frustrating, and didn&#8217;t provide any insights.  Today I found <a title="Bug report for Adium explaining MSN Messenger fix" href="http://trac.adiumx.com/ticket/11574">this obscure post</a> which gives the solution.  Apparently M$N changed the default connection settings without Adium making the change on their end to your account automatically.  To resolve this, open the Preferences panel and Edit the account in question.  Choose the Options tab (I didn&#8217;t even know this existed) and set <strong>Login Server</strong> to <code>messenger.live.com</code>, <strong>Port</strong> to <code>80</code> and turn on (check) the <strong>Connect via HTTP</strong> box.  Once you turn back on your account, everything should be working fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/03/24/fix-for-adium-not-working-with-msn-messenger-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Wordpress Plugin: Unstyle Comment Replies</title>
		<link>http://www.krues8dr.com/2009/03/17/new-wordpress-plugin-unstyle-comment-replies/</link>
		<comments>http://www.krues8dr.com/2009/03/17/new-wordpress-plugin-unstyle-comment-replies/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 22:56:02 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/?p=38</guid>
		<description><![CDATA[I&#8217;ve just created a new Wordpress plugin to unstyle comment replies, which fixes an issues with zebra striping of comments in the newer versions (2.7.x).  You can find out more about it on the plugin page.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just created a new Wordpress plugin to unstyle comment replies, which fixes an issues with zebra striping of comments in the newer versions (2.7.x).  You can find out more about it on the <a href="http://www.krues8dr.com/wordpress-unstyle-comment-replies-plugin/">plugin page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/03/17/new-wordpress-plugin-unstyle-comment-replies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scriptaculous Sortable Create onUpdate Event Not Firing</title>
		<link>http://www.krues8dr.com/2009/02/10/scriptaculous-sortable-create-onupdate-event-not-firing/</link>
		<comments>http://www.krues8dr.com/2009/02/10/scriptaculous-sortable-create-onupdate-event-not-firing/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 02:06:52 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

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

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.krues8dr.com/2009/02/10/scriptaculous-sortable-create-onupdate-event-not-firing/</guid>
		<description><![CDATA[I&#8217;ve been having trouble with a Scriptaculous sortable object that wasn&#8217;t catching the onUpdate function I&#8217;d assigned.  In this case, I was using an UL for the parent with LIs inside. After digging into the code, I discovered that there are several criteria that must be for the actual items that are going to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having trouble with a <strong>Scriptaculous sortable</strong> object that wasn&#8217;t catching the onUpdate function I&#8217;d assigned.  In this case, I was using an <strong>UL</strong> for the parent with <strong>LI</strong>s inside. After digging into the code, I discovered that there are several criteria that must be for the actual items that are going to be sortable, or else the event won&#8217;t fire.  These are:<span id="more-26"></span></p>
<ol>
<li>Each item must have a <strong>unique id</strong>.</li>
<li>The item id <strong>must contain an underscore</strong> (<strong>_</strong>)</li>
<li>The item id <strong>cannot begin with an underscore or a hyphen</strong></li>
</ol>
<p>Using myname_## should work fine, as long as ## is a unique integer in each case.  Technically, it must match the following regular expression:</p>
<p><code>/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/02/10/scriptaculous-sortable-create-onupdate-event-not-firing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Session Dropping Problem with IE 7</title>
		<link>http://www.krues8dr.com/2009/01/26/php-session-dropping-problem-with-ie-7/</link>
		<comments>http://www.krues8dr.com/2009/01/26/php-session-dropping-problem-with-ie-7/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 20:51:12 +0000</pubDate>
		<dc:creator>Krues8dr</dc:creator>
		
		<category><![CDATA[Arcana]]></category>

		<category><![CDATA[Browser Bugs]]></category>

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

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

		<guid isPermaLink="false">http://www.krues8dr.com/2009/01/26/php-session-dropping-problem-with-ie-7/</guid>
		<description><![CDATA[We were just struggling here at work with an insane problem where IE 7 (and ONLY IE 7) was dropping sessions for PHP.   Literally, we would try a trivial test case of creating a session and a new session id (generated with the session_id() function) would appear each time.  Checking the session_save_path [...]]]></description>
			<content:encoded><![CDATA[<p>We were just struggling <a href="http://hotels.vibeagent.com" title="VibeAgent">here at work</a> with an insane problem where IE 7 (and ONLY IE 7) was <strong>dropping sessions for PHP</strong>.   Literally, we would try a trivial test case of creating a session and a new session id (generated with the session_id() function) would appear each time.  Checking the session_save_path showed that new sessions were being created each time.  In the end, we discovered that <strong>IE 7 will not save session cookies if there is an underscore in the domain name</strong>.  (Our development sites frequently have an underscore in the subdomain name - it&#8217;s amazing that we hadn&#8217;t found this out earlier.) We&#8217;ve replaced the underscore with a hyphen, and everything appears to work correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krues8dr.com/2009/01/26/php-session-dropping-problem-with-ie-7/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
