javascript - Cookies are not getting saved in the browser with http header api response -
i trying use cookies authenticate user. node.js sending cookies localhost on login query -
res.cookie('jwt', generatetoken(user), { maxage: 432000, domain: '.localhost.com', httponly: true }
i have moddified windos host file point 127.0.0.1=> test.localhost.com
now when login credentials response header set-cookie option-
setcookie:jwt=eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9.eyjfawqioii1oguzytqxnwjmnjczmdblmjq1mjq1ymqilcjpyxqioje0ote0odcwmtcsimv4cci6mtq5mtq; max-age=432; domain=.localhost.com; path=/; expires=thu, 06 apr 2017 14:04:09 gmt; httponly
but when see cookies in browser shows don`t have cookies http://test.localhost.com:3002
any appreciated.
thanks.
res.cookie('jwttoken', token, { maxage: 2 * 60 * 60 * 1000, httponly: true }); // maxage: 2 hours it's working me. please note maxage in ms.
Comments
Post a Comment