Solved

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

Posted on 2007-03-26
4
868 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 500 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this blog we highlight approaches to managed security as a service.  We also look into ConnectWise’s value in aiding MSPs’ security management and indicate why critical alerting is a necessary integration.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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