{
  "attachments": [],
  "comments_archived": true,
  "date": "2006-04-06T13:46:38.000Z",
  "layout": "post",
  "tags": [
    "asides"
  ],
  "title": "Private client-side cookies for AJAX?",
  "wordpress_id": 925,
  "wordpress_slug": "private-client-side-cookies-for-ajax",
  "wordpress_url": "http://decafbad.com/blog/2006/04/06/private-client-side-cookies-for-ajax",
  "year": "2006",
  "month": "04",
  "day": "06",
  "isDir": false,
  "slug": "private-client-side-cookies-for-ajax",
  "type": "entry",
  "postName": "2006-04-06-private-client-side-cookies-for-ajax",
  "html": "<p>Along with the S3 stuff I'm poking at in AJAX, I'd like to retain the user's key ID and secret for S3 locally so that it doesn't need to be reentered all the time or stuck into constants on a server-held file.  But, I don't want to stick it into cookies or anything that will go over the wire - since the whole point of the HMAC authentication is to prevent that from happening.</p>\n <p>I've looked at <a href=\"http://codinginparadise.org/projects/storage/README.html\">AMASS</a>, but it appears to be broken on Mac - which is a non-starter for me on my PowerBook.  I'm wondering if there's any other practical way to retain a pair of strings locally across browsers for an AJAX app.  Because, beyond just that bit of local storage requirement, I've got entire vistas of persistence available on S3.</p>\n <p>I suppose I could stick the credentials in a cookie, then further encrypt them with a friendlier username / passphrase.  The main issue I see with constantly reentering the credentials is that they're these big honking strings that I'll never be able to remember like a username and password.</p>\n\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221082724\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://crazybob.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2f44965b6a70761c7242eb9ca04bd5e7&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://crazybob.org/\">Bob Lee</a>\n</div>\n\n\n<p><a href=\"#comment-221082724\" class=\"permalink\"><time datetime=\"2006-04-06T19:07:54\">2006-04-06T19:07:54</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Use Flash's client side storage.</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221082727\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221082727\" class=\"permalink\"><time datetime=\"2006-04-06T19:29:30\">2006-04-06T19:29:30</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>That's pretty much what I assumed AMASS did, but it doesn't work on Mac.  Not sure why though, if it's doing something weird above and beyond Flash client-side storage.</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221082728\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://codinginparadise.org\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=96da1b3d8858bfa0306b7c55d3e48270&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://codinginparadise.org\">Brad Neuberg</a>\n</div>\n\n\n<p><a href=\"#comment-221082728\" class=\"permalink\"><time datetime=\"2006-04-07T07:28:20\">2006-04-07T07:28:20</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Hey, I just checked in dojo.storage, which now works on Safari and Firefox/Mac! It's in the head of Dojo, so check it out and see if it works for you; play with src/tests/storage for examples and tests. dojo.storage is the new iteration of AMASS, more stable, cross-platform, and generic for other kinds of storage backends.</p>\n<p>Best,\nBrad Neuberg</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221082730\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221082730\" class=\"permalink\"><time datetime=\"2006-04-07T15:37:23\">2006-04-07T15:37:23</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Brad:  That's hot.  I curse you for making me dive into learning yet another JS framework besides MochiKit.  :)  I may just pluck the storage module out of there, but the rest of Dojo looks keen too.</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221082731\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://diveintomark.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=357a20e8c56e69d6f9734d23ef9517e8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://diveintomark.org/\">Mark</a>\n</div>\n\n\n<p><a href=\"#comment-221082731\" class=\"permalink\"><time datetime=\"2006-04-07T20:04:46\">2006-04-07T20:04:46</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Agreed.  Dojo rocks my world.</p></div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": " <p>Along with the S3 stuff I'm poking at in AJAX, I'd like to retain the user's key ID and secret for S3 locally so that it doesn't need to be reentered all the time or stuck into constants on a server-held file.  But, I don't want to stick it into cookies or anything that will go over the wire - since the whole point of the HMAC authentication is to prevent that from happening.</p>\r\n <p>I've looked at <a href=\"http://codinginparadise.org/projects/storage/README.html\">AMASS</a>, but it appears to be broken on Mac - which is a non-starter for me on my PowerBook.  I'm wondering if there's any other practical way to retain a pair of strings locally across browsers for an AJAX app.  Because, beyond just that bit of local storage requirement, I've got entire vistas of persistence available on S3.</p>\r\n <p>I suppose I could stick the credentials in a cookie, then further encrypt them with a friendlier username / passphrase.  The main issue I see with constantly reentering the credentials is that they're these big honking strings that I'll never be able to remember like a username and password.</p>\r\n\r\n<div id=\"comments\" class=\"comments archived-comments\">\r\n            <h3>Archived Comments</h3>\r\n            \r\n        <ul class=\"comments\">\r\n            \r\n        <li class=\"comment\" id=\"comment-221082724\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://crazybob.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2f44965b6a70761c7242eb9ca04bd5e7&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://crazybob.org/\">Bob Lee</a>\r\n                </div>\r\n                <a href=\"#comment-221082724\" class=\"permalink\"><time datetime=\"2006-04-06T19:07:54\">2006-04-06T19:07:54</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>Use Flash's client side storage.</p></div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221082727\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\r\n                </div>\r\n                <a href=\"#comment-221082727\" class=\"permalink\"><time datetime=\"2006-04-06T19:29:30\">2006-04-06T19:29:30</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>That's pretty much what I assumed AMASS did, but it doesn't work on Mac.  Not sure why though, if it's doing something weird above and beyond Flash client-side storage.</p></div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221082728\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://codinginparadise.org\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=96da1b3d8858bfa0306b7c55d3e48270&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://codinginparadise.org\">Brad Neuberg</a>\r\n                </div>\r\n                <a href=\"#comment-221082728\" class=\"permalink\"><time datetime=\"2006-04-07T07:28:20\">2006-04-07T07:28:20</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>Hey, I just checked in dojo.storage, which now works on Safari and Firefox/Mac! It's in the head of Dojo, so check it out and see if it works for you; play with src/tests/storage for examples and tests. dojo.storage is the new iteration of AMASS, more stable, cross-platform, and generic for other kinds of storage backends.</p>\r\n\r\n<p>Best,\r\n  Brad Neuberg</p></div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221082730\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\r\n                </div>\r\n                <a href=\"#comment-221082730\" class=\"permalink\"><time datetime=\"2006-04-07T15:37:23\">2006-04-07T15:37:23</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>Brad:  That's hot.  I curse you for making me dive into learning yet another JS framework besides MochiKit.  :)  I may just pluck the storage module out of there, but the rest of Dojo looks keen too.</p></div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221082731\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://diveintomark.org/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=357a20e8c56e69d6f9734d23ef9517e8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://diveintomark.org/\">Mark</a>\r\n                </div>\r\n                <a href=\"#comment-221082731\" class=\"permalink\"><time datetime=\"2006-04-07T20:04:46\">2006-04-07T20:04:46</time></a>\r\n            </div>\r\n            <div class=\"content\"><p>Agreed.  Dojo rocks my world.</p></div>\r\n            \r\n        </li>\r\n    \r\n        </ul>\r\n    \r\n        </div>\r\n    ",
  "parentPath": "./content/posts/archives/2006",
  "path": "2006/04/06/private-client-side-cookies-for-ajax",
  "needsBuild": true,
  "prevPostPath": "2006/04/06/upload-from-local-file-via-ajax",
  "prevPostTitle": "Upload from local file via AJAX?",
  "nextPostPath": "2006/04/06/parameterize-your-service-url-for-the-s3-rest-api",
  "nextPostTitle": "Parameterize your service URL for the S3 REST API"
}