HTMLViewer Cache

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?

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.

[quote=444538:@erin jamroz]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.[/quote]

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.

[quote=444558:@Kevin Gale]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.[/quote]

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