HTMLViewer Cache

  1. 2 months ago

    erin j

    Jul 7 Pre-Release Testers, Xojo Pro

    I am having an issue with HTMLViewer remembering too many things. I have a viewer that loads a google form. This form requires a login. However, once I login, no matter how many time I close the window/quit the app, it remembers my user. I am guessing that the html viewer is sending some sort of token to google in the loadURL() command that it has saved.

    How can I stop that behavior?

    I have looked through the forums to try and find out where the cache for htmlViewer (~/Linrary/Caches/<Bundle_Identifier>), this does nothing.
    It seems like one can not clear the cookies for HTMLViewer.

    Thoughts?

  2. Christian S

    Jul 7 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Have you tried to load the logout page?

    Otherwise check out MBS Xojo Plugins with NSHTTPCookieStorageMBS class.
    You can get the cookie and delete it with NSHTTPCookieMBS class.

  3. Tim S

    Jul 8 Canterbury, UK

    @erin j I am having an issue with HTMLViewer remembering too many things. I have a viewer that loads a google form. This form requires a login. However, once I login, no matter how many time I close the window/quit the app, it remembers my user. I am guessing that the html viewer is sending some sort of token to google in the loadURL() command that it has saved.

    How can I stop that behavior?

    I have looked through the forums to try and find out where the cache for htmlViewer (~/Linrary/Caches/<Bundle_Identifier>), this does nothing.
    It seems like one can not clear the cookies for HTMLViewer.

    Hmm. I would not have expected that HTMLViewer would have any cache or do anything about cookies. It should just render HTML and execute javascript. Surely features such as local cache or cookies are implemented by browsers, not by HTMLViewer.

  4. Kevin G

    Jul 8 Pre-Release Testers, Xojo Pro Gatesheed, England

    @Tim S Hmm. I would not have expected that HTMLViewer would have any cache or do anything about cookies. It should just render HTML and execute javascript. Surely features such as local cache or cookies are implemented by browsers, not by HTMLViewer.

    HTMLViewer uses either the OS browser engine or an embedded version of the WebKit engine.
    Most of the functionality you see in browser applications (including cookies & local caching) is actually implemented by the browser engine and not the browser application which means HTMLViewer gets all of that for free.

  5. Tim S

    Jul 8 Canterbury, UK

    @Kevin G HTMLViewer uses either the OS browser engine or an embedded version of the WebKit engine.
    Most of the functionality you see in browser applications (including cookies & local caching) is actually implemented by the browser engine and not the browser application which means HTMLViewer gets all of that for free.

    Humm, OK, thanks, that's worth knowing. But where, then, is the cache and the cookie store? I see nothing in the HTMLViewer events/properties/methods that would allow someone using an HTMLViewer to have any control over either.

  6. Kevin G

    Jul 8 Pre-Release Testers, Xojo Pro Gatesheed, England

    @Tim S Humm, OK, thanks, that's worth knowing. But where, then, is the cache and the cookie store? I see nothing in the HTMLViewer events/properties/methods that would allow someone using an HTMLViewer to have any control over either.

    I don't think Xojo has exposed any kind of access to them.
    On macOS you can use the MBS function NSHTTPCookieStorageMBS. On Win32 I had to declare into: InternetGetCookieExW / InternetSetCookieExW

or Sign Up to reply!