What's the best way to setup a mobile login page (ie, /mobile/login.aspx)? RRS feed

  • Question

  • User1501155440 posted

    What is the best way to setup a mobile login page?  My primary concern is making sure the "Keep me logged in" works for regular users (login.aspx) and mobile users (/mobile/login.aspx).

    So... should I check in my global.asax for a mobile device, then redirect from there?  

    I am worried if I start redirecting in my global.asax I might cause authentication issues.  For example, a mobile user hits the site and it redirects to the /mobile/login.aspx page.  But, because my Forms Authentication has defaultUrl=default.aspx I am not sure where this will direct them too, if they have previously selected "Keep me logged in" from the /mobile/login.aspx page.

    Any insight would be greatly appreciated!

    Monday, April 15, 2013 7:09 PM


All replies

  • User1943143334 posted


    I blogged the same here - http://roopeshreddy.wordpress.com/2012/06/24/detect-requesting-device-type-and-redirect-in-asp-net/

    Hope it helps u...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 17, 2013 9:36 AM
  • User1501155440 posted

    Thanks Roopeshreddy,

    In my case, I ended up creating a single default.aspx and a single login.aspx.

    In my login.aspx page, I have my normal formsAuth code that sets keep-me-logged-in cookie.  If I detect mobile, I swap the stylesheet and just show the same page in mobile format.

    Then, to prevent "too many redirects" errors, I redirect to the mobile/default.aspx page from my default.aspx page.

    Much appreciated!

    Wednesday, April 17, 2013 11:09 PM