I'm not sure what you are asking: is there a problem with your code, or is there something additional you are trying to achieve?
I notice this code in your first post:
Code:
document.cookie="Vln=" + this.value;
This creates a cookie but doesn't set an expiration, so it will be deleted when the browser is closed. Perhaps this is your issue(?).
In which case you probably want a function to set a cookie:
Code:
function setCookie( name, value, expires, path, domain, secure ) {
// Sets the name/value pair - 'expires' is the number of days.
var expires_date;
if (expires) {
expires_date = new Date();
expires_date.setDate(expires_date.getDate() + expires);
}
document.cookie = name + "=" + value +
( ( expires ) ? ";expires=" + expires_date.toUTCString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}