views:

290

answers:

1

I'm writing an ASP.NET MVC application that uses Forms Authentication. The target clients are a variety of mobile web browsers.

When I use the BlackBerry 8530 simulator my MVC app authenticates as expected. I can visit pages whose controller methods are decorated with the [Authorize] attribute - no problem - they display and therefore I assume my Forms Authentication is working correctly.

Using a physical Windows Mobile device to browse my site, I have the same experience as the BB simulator, the forms authentication works as I would expect.

BUT when I try to visit the site using a Blackberry 8900 physical device the Login page keeps on looping back when I click the Login page. The device is not retaining it's "authenticated" status.

I added code to verify this and I can see that: Request.IsAuthenticated: False User.Identity.IsAuthenticated: False

So my question is what next steps can I take to try and find out why the Blackberry 8900 is losing it's authentication status. Is this cookie related?

Anyone have any ideas?

Cheers Derek

+1  A: 

In your web.config, try to put cookieless="true" in the sessionState tag

Gregoire
Gregoire, when I add the cookieless="true" it breaks the URL rewriting.
Derek Mitchell
@Derek Mitchell If you can not modify your URL route neither have cookie, the only remaining solution I see is adding hidden field with session id and transforming each link in form...
Gregoire
@Gregoire - thanks for that suggestion. I guess I could change the route to accommodate the cookieless sesstionState but I don't really want the entire MVC app to be cookieless. Most of the mobile clients don't seem to have any issues with forms based authentication. Based on your idea I might try a custom authorization attribute using the session id...
Derek Mitchell