How to config same port for live site and administration site?

mark json asked on March 18, 2022 09:12

Currently my live site and administration site running on different port from localhost. Both are running via Visual studio.

Problem is I using page builder for live site, so I got error: This page does not work properly as your browser may be blocking 3rd party cookies and/or the system may be incorrectly configured for a multi-domain environment.

I also additional <add key="CMSAdminCookiesSameSiteNone" value="true" /> line to my MVC Web.config but can't resolve this issue.

So I want run both sites on same port.

Current configuration:

Presentation URL: http://localhost:62458
Administration domain name: localhost:51872

Expected configuration:

Presentation URL: http://localhost:51872/live-site
Administration domain name: localhost:51872

Any ideas?

Recent Answers


Juraj Ondrus answered on March 18, 2022 09:45

I do not see any problem when you will configure the web server - either IIS or the VS to use the same port + virtual application. In Visual studio edit the project properties and set the desired startup URL.

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 18, 2022 09:58

My administration site running on port 51872, so I can't running live site on this port in Visual Studio.

I got error Unable to launch the IIS Express Web server. Port 51872 is in use..

Can running on same port in Visual Studio as default Kentico application install (both live site and administration are running on same port)

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 18, 2022 10:10

So, it seems it is limitation of IIS Express in Visual studio. You need to use the full IIS instead and make the apps run in the same site. I would recommend using separate virtual apps or sites in the IIS, do not nest them as it could cause issues - .NET can detect certain settings twice (like virtual web.config files).

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on March 20, 2022 17:38

The message should go away (even with two different ports if you are running HTTPS and not just HTTP). The docs mention this in the diagram (notice that HTTP is not supported with different domains) https://docs.xperience.io/developing-websites/working-with-cookies/configuring-cookie-samesite-mode

Also note the statement in there:

Any unique name registered directly under a top-level domain. For example, sub.domain.com and domain.com are recognized as belonging to a single domain. However, domain.com and microsoft.com are recognized as different domains. The same applies to port numbers – domain.com:8080 and domain.com:8081 are classified as different.

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 21, 2022 09:57

I running both admin site and live site with different ports on localhost. Check Network tab for request get Home page from Page application, I seen cookies is sent now. But I still got message:

This page does not work properly as your browser may be blocking 3rd party cookies and/or the system may be incorrectly configured for a multi-domain environment.
See our documentation for more information.

Maybe I missing any config? I got this problem after upgrade Kentico 12 to Xperience 13.

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 21, 2022 10:12

Any ideas for my issue? Many thanks in advance!

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 21, 2022 10:14

See what Brian replied - you may need to use HTTPS protocol. Or, install full IIS version and configure site and then run the admin and live site apps in virtual apps underneath the site. Or, use different sites in the IIS with different domains (HTTPS also required)

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 21, 2022 10:39 (last edited on March 21, 2022 10:45)

@Juraj Ondrus thank you. I will try, but more question please.

Cookies is sent now in my response headers (I can't make a full response header picture). Maybe issue with my router config?

Image Text

Sorry about this question.

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on March 21, 2022 15:06

Yeah, the screen shot still shows HTTP. Please try with HTTPS.

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 22, 2022 04:38

Thank you, but problem is still persist after config http to https

Image Text Any ideas?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 22, 2022 06:30

What is the hotfix you are using? I would also check the Settings -> System and the Default cookie level setting. Try setting it to All for example.

0 votesVote for this answer Mark as a Correct answer

mark json answered on March 22, 2022 07:13 (last edited on March 22, 2022 07:17)

(1) I just upgrade Kentico 12 to Xperience 13 (there is no hotfix is applied yet).

(2) There is no Default cookie level setting is appear in Settings/System tab.

Image Text

So what hotfix version I should apply?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 22, 2022 08:03

There must be the cookie level setting (screen shot). It has been there for a long time, even in Kentico 12: screen shot.

0 votesVote for this answer Mark as a Correct answer

Arjan van Hugten answered on March 22, 2022 09:36

Are you sure that the port (8089) is correct and that the site has configured Kentico correctly? The 404's could indicate that the Kentico routing paths are not available. Have you configured the following in the route config: "routes.Kentico().MapRoutes();"? Is the site maybe running under a virtual path in IIS?

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on March 22, 2022 15:08

You should be running a recent hotfix version and not 13.0.0. There was a bug in .0 that was resolved for this exact issue in .06. I would recommended hotfixing to at least 13.0.62

Page builder - Incorrectly displayed warnings about blocked 3rd party domain cookies
The cookie level of the system's 'KenticoCookiePolicyTest' cookie (used to detect the 3rd party domain blocking policy of a browser) was too high. This could result in incorrectly displayed error messages in the Xperience administration, e.g. in the page builder interface.
0 votesVote for this answer Mark as a Correct answer

vasu yerramsetti answered on March 23, 2022 20:44

Refer below links regarding error The page does not work properly aa your browser may be blocking 3rd party cookies and/or the system may be incorrectly.......

Configuring cookie SameSite mode -

https://docs.xperience.io/developing-websites/working-with-cookies/configuring-cookie-samesite-mode

https://devnet.kentico.com/questions/kentico-preview-mode-not-working

0 votesVote for this answer Mark as a Correct answer

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