Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

writing and reading BIG size COOKIES (>4Kbytes) in JAVASCRIPT

Posted on 2007-03-26
4
Medium Priority
?
872 Views
Last Modified: 2008-01-09
I need to store a BIG size information on a cookie (more than 30Kbytes!)
I know the limit size is 4K, so I need to decompose it into pieces of 4K

sample of a NOT WORKING script for large size cokies !

function save_cookie() {
      var Objhtml = document.getElementsByTagName('HTML');
      source=Objhtml[0].innerHTML;// source  size = 40Kbytes !
                     alert(source);
      writeCookie('source',source); // this does not work since size >4Kb
      
}
function load_cookie() {
      source=readCookie('source');
                     document.getElementsByTagName('HTML').innerHTML=source;
      alert(source); // this is NULL !
      
}

I need a script to write BIG cookies (crunched into 4Kbytes): ANY SOURCE for that
0
Comment
Question by:yarek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 29

Accepted Solution

by:
Badotz earned 2000 total points
ID: 18842006
Perhaps it is time for a rethink - why not save to a Session or Application object? Or a database, for that matter. AJAX makes any of those options almost trivial.
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 18869597
You have options

1. DO Session Management at Server

2. Split the cookie data in multiple cookies. You can save upto 20 cookies , each 4KB

   
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question