The first version.

Low version browser like IE 7 and below, use cookie for persist storage.
High version browser use localStorage directly.