I have an ASP.NET MVC application and I'm using ASP.NET Identity 2. I have a weird problem. ApplicationUser.GenerateUserIdentityAsync
is getting called for each request browser makes to my website. I've added some Trace.WriteLine
and this is the result after removing IIS output:
IdentityConfig.Configuration called
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Content/bootstrap.css
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Scripts/modernizr-2.8.3.js
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Content/site.css
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Scripts/jquery-2.1.3.js
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Scripts/bootstrap.js
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Scripts/respond.js
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Scripts/script.js
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Glimpse.axd?n=glimpse_client&hash=8913cd7e
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Glimpse.axd?n=glimpse_metadata&hash=8913cd7e&callback=glimpse.data.initMetadata
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Glimpse.axd?n=glimpse_request&requestId=6171c2b0-b6e5-4495-b495-4fdaddbe6e8f&hash=8913cd7e&callback=glimpse.data.initData
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/Glimpse.axd?n=glimpse_sprite&hash=8913cd7e
ApplicationUser.GenerateUserIdentityAsync called url: http://localhost:54294/__browserLink/requestData/38254292a54f4595ad26158540adbb6a?version=2
while if I run a default MVC Application created by template, I'm getting this:
IdentityConfig.Configuration called
and only if I login, It'll call ApplicationUser.GenerateUserIdentityAsync
.
I've looked everywhere I thought it might be but I didn't find any result. I'm using (if it helps)
StructureMap 3
Elmah
Glimpse
ASP.NET MVC 5
EF6
ASP.NET Identity 2
Additional Info
I'm adding users directly into database without using a UserManage. I'm not sure if it makes any problems with Identity or not.
Update
I've dropped database and it didn't happen anymore. What is happening?
Update 2
It happened in my Google Chrome (I monitor SQL connections using glimpse) and after removing stored cookies, It didn't happen. Can logging in in other browsers cause this problem?
Update 3
Also log off - log in seems to solve the problem temporary.