Logon issue (stuck at logon page)

Mar 11, 2011 at 4:37 AM

Hello, guys.

 

I had no trouble whatsoever following this tutorial leading to the authentication part.

I'm running MVC with VS10 SP1 and MySQL (connector 6.3.something). I have several pages and functions in my code that successfully uses the database. 

Everything works well during chapter 7 of the tutorial. I can create users and roles and the schema gets autogenerated. Every time that I go to a page that requires authentication, the logon pages comes up as expected. However, after clicking the "log on" button, the same page gets reloaded. No sign of a failed or a successful logon. It's just the same page. (I saw some people had the same issue, but never reported how to fixed).

Following the code, I noticed that this function never gets called. I assume it should:

public ActionResult LogOn(LogOnModel model, string returnUrl)

 

 

Any hints?

Thanks!

Montes

Mar 11, 2011 at 7:53 AM

I just identified where the problem is:

<sessionState mode="Custom" customProvider="MySqlSessionStateProvider">

<providers>      

<add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="False" autogenerateschema="True" />  

</providers>  

 </sessionState>

 

It appears to be more a MySql/connector issue than a MVC's problem. If I remove this provider, the code works fine and I can authenticate. However, I assume I have no session.

 

Any clue?

 

Thanks

Coordinator
Mar 25, 2011 at 8:32 AM

@Montesinnos - Interesting that you're doing this with MySql. I didn't try that, and the tutorial is written for SQL Server Express. I'm interested in hearing if you figure this out, but I recommend you follow the tutorial using SQL Server Express.

Jun 20, 2011 at 5:18 AM

I was able to resolve this by setting "cookieless" to false as follows:

    <sessionState mode="Custom" cookieless="false" regenerateExpiredSessionId="true" customProvider="MySqlSessionStateProvider">      <providers>        <add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="" connectionStringName="LocalMySqlServer" writeExceptionsToEventLog="True" autogenerateschema="True" />      </providers>    </sessionState>

Coordinator
Jun 23, 2011 at 7:09 AM

Thanks for posting your solution. How are things working for you with Music Store running on MySql?

Jul 28, 2011 at 10:37 PM

@jongalloway

Sorry for the delay on the reply, Jon.

I haven't used the Music Store with MySql, but I applied the exactly same ideas for my project. It has a bunch of small quirks here and there's but it's been working fine.

I have 10 users who log in everyday (internal app) and it's a very decent solution. I have tables with more than 3 million records, searches, concurrent access, etc.

 

The only problem is that project is still in development and it's always a pain to make the DB changes reflect in the Entities.

 

Thanks