|
Dear All I'm developing a django site that I'd like to be accessible from mobile devices. The site is behaving as expecting with desktop browsers (Chrome, Firefox, Safari) and with iPhone and BlackBerry browsers. The Android browser is behaving strangely. Symptom: The site has a very simple login page containing a form with username, password and the {% csrf_token %} tag. When trying to login from the Android phone browser, the page returns the "CRSF verification failed" error page (django running debug=True for the moment). However, the user has been logged in: on reloading the page, I get the page I was expecting, along with the user details. So:
Context:
I can't think what can be the problem. Has anyone else had similar experiences with django's csrf protection, the Android browser and/or webfaction? Can anyone offer any clues? With thanks and best wishes Ivan |
|
Dear neeravk, Thank you for your comment. That's a good question ... Ha! I installed Opera Mini and the site works fine! The error effect only happens with the stock browser! Thanks very much. Do you know what is up with the stock Android browser? Is it based on an old version of IE? Eventually I'm going to have to cope with it. Best wishes Ivan Hi Ivan, Both Froyo and Honeycomb versions use the WebKit engine for their browser, so it's probably a bug. You could search here if such a bug exists and if not, you could as well report it. I am not sure if Opera Mini can be compared with Android browser since Opera Mini renders the page on Opera servers before sending to the phone as far as I know while Android browser renders it on the phone itself. Can you tell us what version of Android you are using? As Ilias stated above, reporting it to the Android bug tracker seems like the best option Can you also check if the Android browser is actually setting the csrftoken cookie or not? |
|
Dear All, thanks for your comments. I have to go offline for a few days. I'll respond properly on Tuesday. Best wishes, Ivan |
|
Dear iliasr, neeravk, Thanks for your help. For now, I've decided to concentrate on the iPhone client, as the webview behaves itself and other parts of development are smoother as well. If/when I come back and solve this I'll post a summary here. Best wishes Ivan |
Does this only happen with the stock browser for Android or with other third-party browsers like Dolphin too?