views:

30

answers:

2

I have a MVC site with AD authorization. This is all working fine. I publish the site to the webserver and call the site directly (http://intranet). If I have not logged in for a while (I have an authorised cookie with a 30 minute TTL), I am prompted to log-in and if successful I am redirected to the homeController's index view. This is great and as expected.

If I keep the session open (browser open) and browse away from the site, if I then browse back to http://intranet, I am not challenged as I have recently authenticated but the default page is from a different controller and not the home page view.

How can I stop this from happening? It cannot be a session setting as this is not a new session and the routes appear correct - they are not beng called at this point anyhow.

Please MVC guru's advise....!

Register route block is as follows:

    public static void RegisterRoutes(RouteCollection routes)
    {
        // standard MVC route regsitration

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "PaginatedTimesheets",                                                 // Route name
            "{controller}/{action}/{page}/{view}",                                 // URL with parameters
            new { controller = "Timesheets", action = "Index", page=0, view=0 }    // Parameter defaults
        );

        routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{id}",                           // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
        );
    }
A: 

What is your default route look like? It should be going to your default controller/action specified in your routes.

Jab
I am sure it is correct - I have appended the RegisterRoutes method to the original comment.
Klaptrap
Where is it going? /Home or /Timesheets? Where are you wanting it to go?
Jab
Have had to place a default.aspx, onto root, with a redirect into MVC application. Works on localserver but not on IIS server - not hunting down issue in IIS7/.NET4.
Klaptrap
A: 

Fixed with redirect

Klaptrap