Problem maintaining session across subdomains

Naresh Ede asked on November 14, 2017 06:03

Hi Guys

I have 3 different sites running in my kentico instance like

ABC.COM

XYZ.COM

PQR.COM.

And for each site i added different domain aliases ;

Earlier i had implemented autologin based on userdata and login for its domain aliases.

Now i had a different issue , session is not maintaining for its sub domain WWW.ABC.COM.

Browser treat its sub domain as different domain.

So my requirement is ABC.COM and WWW.ABC.COM both should login.

Any ideas ?

Thanks

Naresh Ede

Recent Answers


Michal Samuhel answered on November 14, 2017 08:42

Hi Narash,

If cookie has no domain attribute, it is valid only for the exact domain to which the request that sets the cookie is addressed.This is part of http standard:

https://tools.ietf.org/html/rfc6265#section-5.2.3

As is mentioned this can be adjusted by setting domain attribute for the cookie, but this will need to be handled within code of your login implementation.

2 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on November 14, 2017 13:05

Check out this post

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.