I've got the following structure
www.website.com --> ASP.NET 4.0 Web-site
www.website.com/blog --> NET 4.0, Web-Application
Both do form-authentication against the same SQL database and use the framework ASP.NET memberships and roles. I can log into each portion just fine (same user/password) but the authentication doesn't carry over i.e. if I log into /
and then click a link to /blog/
, /blog/
thinks I'm Anonymous and prompts for login again. I've done the basics
i.e.
- Identical
<authentication mode="Forms">
in both the site as well as app web.configs - Identical
<machineKey>
section (yes, identical validationKey and decryptionKey)
So I then inspected the cookies generated and noticed that website and the web application seem to be working on different cookies.
Cookies created by website.com/blog
- .ASPXFORMSAUTH-27604f05-86ad-47ef-9e05-950bb762570c
- .ASPXROLES
Cookies created by website.com
- .ASPXFORMSAUTH
I think this is the problem, although I see it despite having identical <authentication>
sections which looks like
<authentication mode="Forms">
<forms timeout="30" slidingExpiration="true" name=".ASPXFORMSAUTH" enableCrossAppRedirects="true" protection="All" cookieless="UseCookies"/>
</authentication>
I did read several other posts like Single Sign On with Forms Authentication as well as http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx
There were also a few other posts I can't recall now. I've gone through them (all?) but am still stuck. I can gladly supply more debug data if needed.
Would really appreciate any tips someone might have! I think I'm hitting a wall on this one!