Regarding site aliases:Login for Site aliases

Naresh Ede asked on September 14, 2017 14:39


I have site in kentico with main domain And i had given different domain aliases for the site like,

If i was logging in, is it possible to log the two alias sites, also at the same time.

If possible please provide me the solution to achieve that.

many thanks

Naresh Ede

Recent Answers

Trevor Fayas answered on September 14, 2017 15:52

Hi Naresh,

Session's (that stored the logged in status) are stored in a Cookie on the user's browsers. Because cookies are domain specific, the "logged in" session cookie for is not passed to nor

Here's how i worked around it:

First, create a table that has a (Guid) Authorization, (string) UserName, (DateTime) EnterDate.

Next, create a "Site Switcher" Drop down webpart that shows the other websites that the user can switch to. It needs the below logic:

  1. On drop down change, create a new entry for the table with a new random guid, the username, and the current date.
  2. Redirect the user to the other website, passing the authorization guid in the Url (ex:

On the other website, create an "Auto login" webpart, that looks for the authorization guid from the URL. If it finds that Auth in the URL, it needs to do the following:

  1. When it receives the guid, it does a lookup on the table (by authorization GUID) that has an EnterDate within say 2 minutes.
  2. If it finds the record then login the user through Kentico's API, and delete the record.

It may be possible to programatically set the user's session cookie for another domain as well, but i've never tested this and it may not work for security reasons.

0 votesVote for this answer Mark as a Correct answer

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