2

I have successfully tested HTML5 Application Cache under Chromium. For instance:

CACHE MANIFEST
http://localhost/pycoh-mnt/materialRequisition/create

The above URL renders an HTML5 file. When I protect it with cookie-based authentication, Firefox 11 fails; I get an error whose description I could not find, but I think is due to an HTTP Redirect response. If I make the URL public, it correctly caches it.

In the other hand, Chromium 18 handles the caching properly in both cases. I'm afraid Firefox is not sending the cookie information when it issues the caching request.

Any idea? Thank you!

PD. I forgot to say I'm running 64 bits apps.

clapas
  • 1,768
  • 3
  • 16
  • 29
  • Does it work OK with a current Firefox release? – robertc Aug 09 '12 at 18:28
  • @robertc Just tried FF14, and behaves wrongly aswell, but in a different manner: instead of triggering the _cached_ final event when no cache existed, it triggers the _updateready_ event (and then calling swapCache() gives an error, but this is another story). FF 11 correctly triggers the _cached_ event after first caching. As for the topic of the post here, **FF14 appears to send the cookie information together with the request**. Nonetheless, the pages with certain HTTP _Cache-Control_ attributes (i.e. no-cache) aren't available when in offline mode anyway. Chromium does this correctly. – clapas Aug 10 '12 at 09:14
  • I suggest you file a bug in http://bugs.mozilla.org/ if you feel that the behavior differs what the spec states – Mikko Ohtamaa Aug 10 '12 at 09:18
  • @MikkoOhtamaa I'll do that when I'm sure about it being a bug. I would like to wait a bit and hear other people's experiences. It amazes me nobody else has issues with Application Cache under Firefox! It looks unusable! – clapas Aug 10 '12 at 09:27
  • I don't think anyone else is trying to use a temporary storage feature like cookies to control a permanent storage feature like AppCache. – robertc Aug 10 '12 at 10:18
  • @robertc So you think the html5 offline feature is not appropriate for caching content protected by cookie-based authentication? Anyway, as I said above, even when cached, certain pages aren't available when in offline, unless I fetch them using Ajax. – clapas Aug 10 '12 at 10:56
  • If the pages are at all volatile or user specific then they're not something that the AppCache is designed to hold. That's not that what your doing can't be made to work, I just expect you'll run into a lot of little issues like this because the things you need to work are edge cases for the intended functionality. It works best if you separate your pages into templates and data, then keep the templates in AppCache load the data dynamically and keep it in Local Storage or IndexedDB. – robertc Aug 10 '12 at 12:01
  • Thank you for your thoughts @robertc, I remind you that my application works perfectly under Chromium, so the point here is whether Firefox complies with the html5 specification or not. I think it does not, but I will investigate it with the mozilla community and update this as soon as I have any news. – clapas Aug 10 '12 at 18:39
  • If you read [the spec](http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html) there's very little mention of cookies at all, ie. what the browsers do with cookies in these situations is unspecified. – robertc Aug 10 '12 at 20:34

1 Answers1

1

Check if third party cookies are disabled in FF. There is currently a bug in FF that prevents cookies from being sent in the manifest request when 3rd party cookies are disabled:

http://bugzilla.mozilla.org/show_bug.cgi?id=722683

ampersand
  • 4,264
  • 2
  • 24
  • 32