Issue in cookies while loading in browser
I am trying to implement a webpage with node.js using hbs engine and
express framework... after login i m trying to catch cookies and check in
one page as authentication.
app.get('/path', function (req, res) {
var cookie= req.cookies.UserId;
if (cookie != ''||cookie !=null)
{
//doing somethig
}
else
{
res.redirect("some url");
}
}
but when i m giving direct url without login this condition get failed and
it is not checking for cookies. Initialy cookie is null only still it is
failed to redirect..what is the solution for this?
No comments:
Post a Comment