node.js - Cookie share with subdomain nodejs httponly cookie -


i using express-session module maintain session. have 2 app. want share cookies apps, parent app run in example.com , , child app run in child.example.com. set httponly cookie using express-session sets in child app.i can verified cookie in resource tab in chrome debugger.

network tab:

when first call sub-domain: load "http://www.child.example.com" cookie set in request. while url redirect server ip . cookie not available after that.

like http://13.25.230.2/index cookie not avaliable on

when send set-cookie http header, can specify domain for.

set-cookie: name=value; domain=example.com 

the domain must suffix of domain hosting page.

i.e. foo.example.com, bar.baz.example.com , www.example.com can share cookie belonging example.com.

a url using ip address has no hostname in @ , cannot match rule.

there no way share cookie between example.com , 13.25.230.2. give site hostname instead.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -