created user cookie and added usage if req.user is undefined