So we have a website hosted at www.website.com and another web app hosted at www.app.website.com.
The www.website.com is available for anonymous users and created using Wordpress.
On the other hand, www.app.website.com is a Html5 + AngularJs + C# Web API, that relies on cookie authentication.
Current scenario
- A user visits www.website.com and clicks "login"
- The browser redirects them to www.app.website.com
- If they are authenticated then www.app.website.com redirects them to the authenticated users page
- Otherwise, redirects them to the login page
Question
- A user visits www.website.com
- If they are authenticated, i.e., have a valid cookie, www.website.com should redirect them to www.app.website.com
- Otherwise, they will stay in www.website.com until they press "login"
As far as I understand we can issue cross domain cookies but for security reasons we should prevent Javascript from accessing them.
With this in mind, what would be the best redirect strategy?
Edit: The issued auth cookies are HttpOnly.