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.
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.
Member
231 Points
253 Posts
What's the best way to setup a mobile login page (ie, /mobile/login.aspx)?
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!
Star
14065 Points
3270 Posts
Re: What's the best way to setup a mobile login page (ie, /mobile/login.aspx)?
Apr 17, 2013 09:36 AM|roopeshreddy|LINK
Hi,
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...
Roopesh Reddy C
Roopesh's Space
Member
231 Points
253 Posts
Re: What's the best way to setup a mobile login page (ie, /mobile/login.aspx)?
Apr 17, 2013 11:09 PM|Jason Duncan|LINK
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!