I am creating a mobile version of the site. Almost all the major work is done but one confusing thing is becoming a hurdle for me. I have pasted some JavaScript code on the main website to redirect the mobile users to mobile web site. Now in the footer of mobile web site I also have the link to main website in case if mobile user wishes to visit it, he should be able to so easily.
But when they click on the link redirecting to the main web site they will be redirected back to the mobile web site. How should I fix that?
I was thinking about PHP REFERRER.
A good tutorial on this can be found here: http://mobile.tutsplus.com/tutorials/mobile-web-apps/mobile-browser-detection/
If you want to keep the user's choice I'm thinking session or cookie. Either way, check it every time you go through the redirect code and don't run the code if the user has already expressed his option.