<section>
<?= t_head('Set Temporary Cookie', "5–10") ?>
<p>First, open Firefox’s cookies listing by going to <strong>Preferences…</strong> → <strong>Privacy</strong> → <strong>remove individual cookies</strong>. Type <samp>info343.ischool.uw.edu</samp>. You should initially see no cookies listed.</p>
<p>Download the following HTML skeleton:</p>
<p class="resource"><a href="minilab18.html">minilab18.html</a></p>
<p>Create a <samp>minilab18.js</samp> file which creates a temporary cookie. Then look at it in the Cookies window. If you completely exit your browser (closing all windows) and return to the page, the cookie will be gone.</p>
</section>
<section>
<?= t_head('Set/Delete Persistent Cookie', '5–10') ?>
<p>Now create the cookie with an expiration of one day using the <code>expires</code> parameter. Restart your browser and open the Cookies window to verify that it’s still there.</p>
<p>Set the cookie to be deleted, by changing its expiration to be any negative number. Now when you restart your browser, the cookie will be gone.</p>
</section>
<section>
<?= t_head('Welcome Message with <code>localStorage</code>', '10–15') ?>
<p>Now create a welcome greeting using <code>localStorage</code> to store the time of the user’s last visit. (This information won’t expire.)</p>
<p>If this is the user’s first visit, inject a welcome message into the <code>#welcome</code> paragraph. If this is not the user’s first visit, display the time they last visited.</p>
<p>To delete the <code>localStorage</code> value for testing, use the Firebug Console:</p>
<pre><code><span style="color: blue">>>></span> localStorage.removeItem('<var>name</var>')</code></pre>
</section>
<footer>
<p>If you’ve finished everything, good job! Experiment with setting and storing preferences for an app.</p>
</footer>