Hello experts, i want to store the values of my checkbox which are checked into cookies.But i can not do it.here is my code: function keepID(value) { i = 0; var ca = document.cookie.split(';'); for(i=0;i<<?php echo $_SESSION['row'] ?>;i++) { if(document.myform.chkID.checked==true) { ca=value; } } } my checkboxes are moving in a loop: <input type="checkbox" name="chkID[]" id="chkID" value="<?=$rowSubjects['ID']?>" onClick="keepID(<?=$rowSubjects['ID']?>)"> Please help...