Im developing a flash game and I'd like to know how much info can I store in a browser cookie.

The game is simple, but it needs to store several variables in order to save all the details of your current progress.

The game is only one swf file, no server, no nothing.

I need to know how should I use the cookies to achieve this, and if they have the posibility of doing it, of course.

(several = 200 variables i.e)


3 Answers 3


It is important to note that Flash cookies (or Local Shared Objects, as they are called) are different from browser cookies stored by webpages and JavaScript.

From the Wikipedia article on Local Shared Objects:

By default, a Flash application may store up to 100kb of data to user's hard drive (browser cookies have a limit of just 4kb). The defined storage sizes are 0kb, 10kb, 100kb, 1Mb, 10Mb, and Unlimited. If the current limit is exceeded, the user is shown a dialog requesting storage space of the next size. The user may override the amount manually by clicking the Flash application with right mouse button and selecting Settings; however, this applies only to the domain of the Flash movie. If the selected setting is smaller than the current data size, the data is deleted.

  • \$\begingroup\$ Didnt know that, thx. \$\endgroup\$
    – Artemix
    Commented Feb 17, 2011 at 20:24
  • \$\begingroup\$ Users can also disable Local Shared Objects by setting the storage limit to 0kb. Make sure to check that and don't let you application crash because of it. \$\endgroup\$
    – bummzack
    Commented Feb 17, 2011 at 21:26
  • \$\begingroup\$ @Artemix, you can interact with JavaScript from flash using ExternalInterface and set normal cookies as well. Additionally, you can have flash send XHRs (AJAX) to a server and store data in a database, or session. \$\endgroup\$
    – zzzzBov
    Commented Feb 23, 2011 at 16:33
  • \$\begingroup\$ Maybe Im wrong, but I think I cant call any JS function when I have only a swf file to work with, most sites (game portals mostly) work with one swf file only, and thats all. \$\endgroup\$
    – Artemix
    Commented Feb 23, 2011 at 20:51

Browser cookies are generally limited to 4k, Flash LSOs default to 100k but the user and raise or lower this I think: http://en.wikipedia.org/wiki/Local_Shared_Object


Two things to note:

  • Browser cookies need to be transferred back and forth between the client and the server when each page is loaded, which can slow down a site's loading speed.
  • The new HTML 5 client storage APIs can provide a much better solution to storing data on the client side. This can, of course, be transferred back and forth between the client and the server when necessary. Check this article for more info.
  • \$\begingroup\$ Im making a Flash game, but thx anw. \$\endgroup\$
    – Artemix
    Commented Feb 23, 2011 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .