Mmm… Cookies. In ActionScript / JavaScript.

I like cookies – they’re like the poor man’s server-side session.

Yes, Cookies aren’t 100% reliable, I know, but I think for a lot of things, they’re a damned good solution.  Flash has it’s own version of cookies, of course – called Shared Objects – but there’s a few problems I can think of with them;

  1. They’re not very well integrated with the browser.  A user might expect cookies to track information about themselves, but they also expect that – at any point in time – they can clear the cookies themselves and reset everything. You (the developer) might not want the user to be able to do this, but tough, the user should be able to do it.  People to prefer to work with things they understand, and understand the limits of.
  2. They’re only available via Flash.
  3. They’re a pain to work with.

So, cookies.  There’s a couple of great resources out there for dealing with cookies in JavaScript and ActionScript 3.0. Quirksmode (http://www.quirksmode.org/js/cookies.html) is unparallelled for its discussion and practical examples of working with Cookies in JavaScript.

And in:flex Blog (http://myflex.wordpress.com/2008/11/12/actionscript-cookie-util/) has an excelent, fully featured, self-contained ActionScript 3.0 class library for reading, writing and deleting cookies, all without external functions.  Which is very clever.

, , , ,

About James

James is a Senior New Media Developer at MMT Digital, and has BA(Hons) in Design for Interactive Media from the University of Gloucestershire. He loves designing and producing all sorts of website and Flash-related things, as well as prattling on about technologies.Day-to-day he works with Flash, Dreamweaver, Director, Microsoft Office Sharepoint Server 2007 (MOSS) and in his spare time he mucks about in Flex and Wordpress.Follow James on Twitter.

Connections and Related Posts

You can connect with Psyked.co.uk through other media using these links:

No comments yet.

Leave a Reply

Note: This post is over 3 years old. You may want to check later in this blog to see if there is new information relevant to your comment.