In some scenarios you might want to check if the current visitor is authenticated in the admin portal. This might be to adjust the website behaviour specifically for admin visitors.
Is there a Kentico API that we can use on the .NET front-end to detect if the visitor is authenticated in the admin site?
If not, I think just checking for the existence of the admin authentication cookie seems to work well:
var adminCookie = Request.Cookies[".AspNetCore.Xperience.Application"];
Are there any other suggestions?
Environment
- Xperience by Kentico version: [29.3.0]
- .NET version: [8]