dimanche 8 octobre 2017

Different cookies for domain and subdomain

I'm creating applications with NodeJS (LoopBack).

My main app is hosted on: domain.com, additional application - app.domain.com.

By using res.cookie(name, value, [, options]) I setup cookies at the client side with the next line res.cookie('testName', 'testValue', {maxAge: 123456, secure: true, domain: 'domain.com'}).

When I try to setup cookies with this line, instead of domain.com I get .domain.com and cookies are shared between main domain and subdomain.

The problem is that I need to setup cookies separately. One cookies for domain.com another one for app.domain.com.

Thanks!




Aucun commentaire:

Enregistrer un commentaire