4789787
12-20-2009, 09:27 PM
I know this probably sounds like a usual question but it isnt. I dont want my website to detect the iPhone user agent and redirect. What i want it to do is to detect the iPhone user agent and if the user agent is ANYTHING other then the iPhone user agent then it will redirect to the home page. I need to do this because im programming a web based iPhone app that will be paid for on the app store but if they can go to the url on their computer and not pay thats obviously not fair. I know it can be done because other web based games do it i just cant find out how.
aj_nsc
12-21-2009, 07:32 AM
It's actually the same thing, just a matter of when to redirect.
However, for your purposes, it's not even remotely a satisfactory measure of security to do this. All it takes is to disable JS while going to the url so that you don't get redirected, or, faking your useragent, again, an extremely easy feat for anyone with just a little know-how about their browser.
Another flaw, if I put the url for the app in my iPhone (when I didn't pay for it on the app store) I would also be able to access the URL.
Some sort of authentication needs to be performed -using something other than JS