Aidan
Aidan

Reputation: 185

save large chunk of JSON without cookies

I am writing an HTML/JavaScript program that gives me a JSON object as a string.

I want to save that string as a cookie, but the string is too large to be saved as a cookie.

How can this JSON string be saved without cookies?

Upvotes: 1

Views: 636

Answers (4)

Milimetric
Milimetric

Reputation: 13549

The two sort of mainstream ways to do this are to store it in local or server side databases:

So server side you can look at SQL Server, MySQL, PostgreSQL, Oracle, etc. Client side you can look at Local Storage: http://diveintohtml5.ep.io/storage.html

Upvotes: 0

slandau
slandau

Reputation: 24062

Save it in the session or cache it?

We need to know more information. What framework are you using? Is the only technology you want to use HTML/Javascript?

Upvotes: 0

Joe
Joe

Reputation: 82624

Depending on browser coverage, you can use HTML LocalStorage object. Or flash cookies as an alternative.

Upvotes: 3

shelman
shelman

Reputation: 2699

Does it need to stick around when you leave the page? If not, just store it in a javascript variable.

Upvotes: 1

Related Questions