yarek
asked on
writing and reading BIG size COOKIES (>4Kbytes) in JAVASCRIPT
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.getElementsByTagN ame('HTML' );
source=Objhtml[0].innerHTM L;// source size = 40Kbytes !
alert(source);
writeCookie('source',sourc e); // this does not work since size >4Kb
}
function load_cookie() {
source=readCookie('source' );
document.getElementsByTagN ame('HTML' ).innerHTM L=source;
alert(source); // this is NULL !
}
I need a script to write BIG cookies (crunched into 4Kbytes): ANY SOURCE for that
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.getElementsByTagN
source=Objhtml[0].innerHTM
alert(source);
writeCookie('source',sourc
}
function load_cookie() {
source=readCookie('source'
document.getElementsByTagN
alert(source); // this is NULL !
}
I need a script to write BIG cookies (crunched into 4Kbytes): ANY SOURCE for that
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. DO Session Management at Server
2. Split the cookie data in multiple cookies. You can save upto 20 cookies , each 4KB