my page is not working with cookies using javascript and url redirecting
if userid/username(cookies) already in my browser, it comes thank for vote,otherwise it goes to login page..what is the problem in below code
<script type="text/javascript">
var userid = document.cookie;
var username = document.cookie;
if (userid != null && username != null)
{
$('.review-footer-new').find('.review-feedbackLink').click(function (){
if ($(this).closest("a").is("[disabled]")) {
return false;
}
$(this).addClass("selected");
$(this).parent().after("<span class='thanks'> Thanks for your vote! </span>");
$(this).closest(".review-feedbackQuestion").find(".review-feedbackLink").closest("a").attr("disabled", "disabled");
});
}
else
{
window.location = "http://localhost/login.aspx";
}
</script>