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

<channel>
	<title>Gluue &#187; programming</title>
	<atom:link href="http://gluue.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://gluue.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 21 Dec 2016 14:23:49 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>Making Sessions Smarter</title>
		<link>http://gluue.com/2010/08/making-sessions-smarter/</link>
		<comments>http://gluue.com/2010/08/making-sessions-smarter/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 15:39:43 +0000</pubDate>
		<dc:creator><![CDATA[Joe]]></dc:creator>
				<category><![CDATA[Staction]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://gluue.com/?p=2358</guid>
		<description><![CDATA[Staction is built in PHP. For all it&#8217;s occasional syntax weirdness, it is an amazingly flexible and liberating language. PHP does so many things incredibly well, and we&#8217;re big fans. One thing however that it&#8217;s not so great at (in our opinion) is session management. The default garbage collector from PHP isn&#8217;t perfect, and consistently [&#8230;]]]></description>
				<content:encoded><![CDATA[	<p><a href="http://gluue.com/wp-content/uploads/2010/08/st-session-illustration.jpg"><img src="http://gluue.com/wp-content/uploads/2010/08/st-session-illustration.jpg" alt="Staction Sessions" title="st-session-illustration" width="275" height="330" class="alignleft size-full wp-image-2360" /></a>Staction is built in <span class="caps">PHP</span>. For all it&#8217;s occasional syntax weirdness, it is an amazingly flexible and liberating language. <span class="caps">PHP</span> does so many things incredibly well, and we&#8217;re big fans. </p>

	<p>One thing however that it&#8217;s not so great at (in our opinion) is session management. The default garbage collector from <span class="caps">PHP</span> isn&#8217;t perfect, and consistently removes session files that it shouldn&#8217;t, almost totally ignoring whatever setting you have for expiration time. It&#8217;s frustrating for us, and often causes untimely logouts for our users.</p>

	<p>A few weeks ago we started working on a bespoke database driven session system for Staction. The first part came together much easier, and better than we expected. But we still had a problem. After launching the new programming on our dev server we were still getting booted and timed out. Or more to the point, I(Joe) was still getting booted out. </p>

	<p>I&#8217;m a long time Safari user, and Brian, who was working on the programming, is on the Chrome side of life. Not everyone here was having the problem on Safari, so we started thinking maybe it was just me. After resetting Safari totally, the problem still persisted. Brian, who had also started using Safari as a daily browser for testing, started experiencing the problems, too. </p>

	<p>Lots of research, and trial-and-error later we wound up here: <a href="http://discussions.apple.com/thread.jspa?messageID=12078357">http://discussions.apple.com/thread.jspa?messageID=12078357</a> -10 pages long of people with the exact same problem. Safari occasionally, and arbitrarily sends a new <span class="caps">HTTP</span> header without any session information. So after our <strong>WTF</strong> moment, we started thinking of a workaround.</p>

	<p>After a couple other ideas that were non-starters, now once in every 50 calls (approx.) we regenerate the session data, duplicating it into a new session, wiping out the old data and sending the browser a new cookie.</p>

	<p>We&#8217;re incredibly happy to tell you that since making that change we haven&#8217;t been logged out once on our dev server. On Safari, or any other browser. </p>

	<p>This morning we pushed out the new session management programming to all Staction accounts. We hope to push it to all the other apps in the next couple weeks.</p>

	<p>As we always like to learn from an experience, here are our takeaways:
	<ul>
		<li>Don&#8217;t always assume the problem is with what you&#8217;re doing. Check external factors too.</li>
		<li>When you start to work on solving a problem, be prepared for the problem to evolve as you learn more about it.</li>
		<li>Make time for solving the little problems with your app. There is nothing glamorous or exciting about improving our session management programming. We can&#8217;t say &#8220;With sessions that actually keep you logged on!&#8221; on our sales site. But we think improving the foundations for these things helps make the app more satisfactory to use. You&#8217;ve got to do them, even if it would be more fun to work on email-in on Paprika, or new Jumpchart import/export features.</li>
	</ul></p>]]></content:encoded>
			<wfw:commentRss>http://gluue.com/2010/08/making-sessions-smarter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Programming is a Craft.</title>
		<link>http://gluue.com/2010/07/programming-is-a-craft/</link>
		<comments>http://gluue.com/2010/07/programming-is-a-craft/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 14:40:32 +0000</pubDate>
		<dc:creator><![CDATA[Kristin]]></dc:creator>
				<category><![CDATA[Paste]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://gluue.com/?p=2096</guid>
		<description><![CDATA[Programming is a craft. At its simplest, it comes down to getting a computer to do what you want it to do (or what your user wants it to do). As a programmer, you are part listener, part advisor, part interpretor, and part dictator. You try to capture elusive requirements and find a way of [&#8230;]]]></description>
				<content:encoded><![CDATA[	<p>Programming is a craft. At its simplest, it comes down to getting a computer to do what you want it to do (or what your user wants it to do). As a programmer, you are part listener, part advisor, part interpretor, and part dictator. You try to capture elusive requirements and find a way of expressing them so that a mere machine can do them justice. You try to document your work so that others can understand it, and you try to engineer your work so that others can build on it. What&#8217;s more, you try to do all this against the relentless ticking of a the project clock. You work small miracles every day. &#8211; <a href="http://www.pragprog.com/the-pragmatic-programmer">Andrew Hunt and David Thomas</a></p>]]></content:encoded>
			<wfw:commentRss>http://gluue.com/2010/07/programming-is-a-craft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 220/261 objects using disk

 Served from: gluue.com @ 2026-06-08 20:56:43 by W3 Total Cache -->