Tonight I was working on an MVC3 project, which uses an MySQL database. For the admin area I’m using the MySQL membership provider to add users and roles. While clicking through the ASP.NET configuration wizard I have enabled all options for the MySQL membership provider.
After I ran the configuration wizard I started my project to check if the users and roles where working. It didn’t. HttpPost actions where not executed, instead the HttpGet action was executed. After a while I found out that there was a strange kind of folder / query string added to my url.
http://localhost/(S(0swhj3f12244dysv5nj445gx))/
I really had no idea where this thing came from. Compared my solution to another solution (I first checked if this solution was still working) and after a while I found out that my other solution was only using a few options of the MySQL membership provider. Than I started removing parts of the membership that I don’t really needed. After removing the sessionState provider the url was working normal again.
See below codeblock that I removed from my solution
1 <sessionState mode="Custom" cookieless="true" regenerateExpiredSessionId="true" customProvider="MySqlSessionStateProvider"> 2 <providers> 3 <add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" 4 applicationName="my app" description="my app" connectionStringName="MyAppDB" writeExceptionsToEventLog="False" autogenerateschema="True" /> 5 </providers> 6 </sessionState>
Well that’s it. Seems like that MySQL sessionstate and MVC3 are not really working together.
I haven’t checked out why this behavior is occurring or if it’s also happening when using the ‘standard’ sessionstate provider. If you have any ideas please let me know.