cookie problem
I want to convert a variable (sec) inside a javascript function (count) to a string and save it into a cookie inside the jsp, but jsp cannot recognize the variable. Can anyone help me?
<head>
<script language="JavaScript">
var sec=30;
function count(){
sec-=1;
window.status = sec;
if (sec==0){
window.alert("Time's up!!");
return;
}
countdown = setTimeout("count()",time_slot);
}
</script>
</head>
<body onload="count()">
...
<%
int second;
Cookie count_down =new Cookie("count_down_time",sec);
second = 60 * 60 * 24;
count_down.setMaxAge(second);
response.addCookie(count_down);
%>
...
</body>
how can I convert thesec into string and let jsp recognize it?

