<?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>Justin McCormick &#187; Programming</title>
	<atom:link href="http://justinmccormick.com/wp/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://justinmccormick.com/wp</link>
	<description>A blog about Technology</description>
	<lastBuildDate>Fri, 13 Jan 2012 22:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP Sessions Explained</title>
		<link>http://justinmccormick.com/wp/programming/php-sessions-explained</link>
		<comments>http://justinmccormick.com/wp/programming/php-sessions-explained#comments</comments>
		<pubDate>Thu, 23 Sep 2010 07:09:28 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://justinmccormick.com/wp/?p=86</guid>
		<description><![CDATA[Introduction One of the most common requirements for any web application are sessions. Sessions are used to maintain information about a user on the server instead of using a cookies. Although session ids are stored in a cookie its considered more secure because a user cannot tamper with the contents of a session. If a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
One of the most common requirements for any web application are sessions.  Sessions are used to maintain information about a user on the server instead of using a cookies.  Although session ids are stored in a cookie its considered more secure because a user cannot tamper with the contents of a session.  If a user were to modify their session identifier PHP would just create a new session based on the new id.</p>
<p><strong>Using Sessions</strong><br />
For each page that requires session data session_start() must be called.  This causes PHP to read the users session id and load the data into RAM.  Once loaded it is accessible via the $_SESSION super global array.  From their you can modify the contents of $_SESSION.</p>
<p><span size="0.7em">Note: session_start() cannot be called once output has started.  A warning will be displayed and its possible the session could be lost.  If you are seeing the error &#8220;Cannot send session cache limiter&#8221; check to make sure no output is going to the browser.  A common problem is an unwanted space or tab at the outsize of the PHP tags.</span></p>
<p>Once you are done with a session you can call session_close() to force the modifications to the session to be saved.  This is not required as PHP will automatically do this once the script ends.</p>
<p>The following is a short example of using a session.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;hits&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;You've visited this page &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;hits&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; time(s).&quot;</span><span style="color: #339933;">;</span>
    session_close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>Behind the Scenes</strong><br />
PHP makes using sessions easy, but what you don&#8217;t see is what its doing behind the scenes.  The default PHP installation uses temporary files on the local disk for storing the session contents.  When a session is started PHP will read the file which contains the serialized contents of $_SESSION.  The data is unserialized and then placed in $_SESSION.  When the session is closed, $_SESSION is serialized and stored in the temporary file.</p>
<p>The more unique hits you receive the more session files are created.  Allowing these files to buildup could cause problems on the web server.  It may run out of space, or you could hit the max file limit.  To prevent this from happening for each new session PHP runs a cleanup routine.  All session files that have timed out are removed from disk.</p>
<p><strong>Custom Session Handlers</strong><br />
There is nothing to prevent you from making your own session handling system.  The PHP session handler is only provided as a convenience.  However before you &#8220;remake the wheel&#8221; you should consider overriding PHP&#8217;s session system using session_set_save_handler.  This allows you to override each of the six internal PHP session calls: open, close, read, write, destroy, and garbage collect.  Using this method you can create your own method of handling session data.</p>
<p>PHP&#8217;s documentation contains an example of how to use session_set_save_handler() <a href="http://us.php.net/session_set_save_handler">here</a>.</p>
<p>If you would like some more examples leave me a comment with what you would like to see.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinmccormick.com/wp/programming/php-sessions-explained/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Things to consider before outsourcing</title>
		<link>http://justinmccormick.com/wp/technology/things-to-consider-before-outsourcing</link>
		<comments>http://justinmccormick.com/wp/technology/things-to-consider-before-outsourcing#comments</comments>
		<pubDate>Wed, 04 Jun 2008 04:50:15 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[outsourcing]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://justinmccormick.com/wp/?p=13</guid>
		<description><![CDATA[Recently I had the advantage of exploring a side of programming that is becoming all the more popular in the business world of software development, Outsourcing. Now at first outsourcing may sound like a great idea. Pay others to develop on your product without having to worry about hiring temporary employees. However, as easy as [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had the advantage of exploring a side of programming that is becoming all the more popular in the business world of software development, Outsourcing.</p>
<p>Now at first outsourcing may sound like a great idea.  Pay others to develop on your product without having to worry about hiring temporary employees.  However, as easy as this sounds, there are some things you need to consider before you attempt to outsource your product.<span id="more-13"></span></p>
<ol>
<li><strong>Learning curves: </strong>Unfortunately, your outsourcer is going to be at a huge disadvantage, they have no experience with your code.  It is harder for an outsourcer to reverse engineer your software enough to program new features, mainly because they lack the ability to keep in constant contact with you.  It is easier for a temporary employee to learn the code because they have access to your best resource, your developers.  This issue is even further complicated if you are using resources outside of your country.  It is hard for an outsourced developer to ask questions while your development team sleeps.</li>
<li><strong>Language Barriers</strong>: When using an outsourcer outside of your country, communication may not only be affected by time differences, but language barriers.  Your outsourcer may not be all too familiar with your language.  Items may get lost in translation.  This becomes a large issue when you discover the outsourced developer&#8217;s interpretation of your design or product requirement document is completely different from the wanted feature.</li>
<li><strong>Proper Documentation</strong>: Most outsourcers have been trained to program an item specifically to the requirements document.  Your documentation should cover every detail to help the outsourcer better understand the features you want.  This also extends into the realm of your current software documentation.  The more documentation you have about your existing code, the easier it will be for an outsourcer to develop and implement his/her assigned tasks.</li>
<li><strong>Coding Standards</strong>: Are often ignored by an outsourcer.  Most outsourced developers are required to program as quickly and efficiently as possible.  This can lead to your software coding standards to be overlooked.  Even though the functionality has been added to the software, this doesn&#8217;t mean that the functionality can be easily extended, or even maintained well.</li>
<li><strong>Loyalty</strong>: One thing that can&#8217;t be purchased is loyalty.  To an outsourcer, you are a client.  Next week their will be another client.  Their loyalty is with the outsourcing company, not the client.  Keep this in mind because loyal employees will be more motivated to make the software better, where an outsourcer is just trying to get the job done.</li>
<li><strong>Proper Training</strong>: Make sure you have the time to properly train the outsourcer, not just in the code, but on the actual software.  It will ease development time if the developer knows where certain functionality is in the UI so that it can easily be traced in the code.  Without proper training, you are more likely to encounter features that are not fully implemented because the developer didn&#8217;t know about another part of the software.</li>
<li><strong>Development Environment</strong>: Outsourcers may not use the same editing tools and operating systems that you develop with.  This becomes especially important when an outsourcer uses Windows and your team uses Linux.  Line ending differences can cause merge problems in source control systems.  Make sure you can have your outsourcer use the same environments that you develop on.</li>
</ol>
<p>Even though there can be difficulties in using outsourcers, I don&#8217;t feel it is a bad thing.  Using an outsourcer can provide an easy gateway to get the help you need fast, especially when its difficult to find unemployed programmers.  But, also think, is it better to delay your release to make sure everything is right and as bug free as possible, or get the product out the door by using developers unfamiliar with your software.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinmccormick.com/wp/technology/things-to-consider-before-outsourcing/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.357 seconds -->

