In a nutshell, I'm trying to figure out how to programmatically enable and disable the redirection for mobile phones, based on a session value, on a per request basis (not statically for everyone).
Here's the back story:
I'm currently using 51Degrees in my ASP.NET application to redirect requests to the mobile version of the site. I would like to add a feature where users can enable and disable this redirection from a "Settings" page. The setting will be different for each user, and so far every setting I've found to disable 51Degrees is static. This makes it difficult to disable it for a subset of users.
One semi-solution I had was to set firstRequestOnly="true"
and reverse the redirect if it wasn't supposed to happen. Although firstRequestOnly="true"
has caused a number of other headaches (unrelated) so I would like to keep it at firstRequestOnly="false"
and simply enable/disable the redirection based on a session value per request, or per user. The problem is that I can't figure out a clean way to do this.