Last post Apr 17, 2013 11:09 PM by Jason Duncan
Apr 15, 2013 07:09 PM|Jason Duncan|LINK
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!
Apr 17, 2013 09:36 AM|roopeshreddy|LINK
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...
Apr 17, 2013 11:09 PM|Jason Duncan|LINK
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.