B4J Question Webview Cookies

Discussion in 'B4J Questions' started by Ivan Judd, Dec 1, 2019.

  1. Ivan Judd

    Ivan Judd New Member Licensed User

    I'm trying to use a webview in a B4J application but it only appears to be saving the cookies into memory which is a default setting going by the Java documentation rather than a file so my web application doesn't stay logged in as the cookie is lost when it closes.

    I've put the following code in that let's me see that the cookies are being received plus I can run a debugger on the server and see if the cookies are being sent back from the webview.

    My JavaScript also saves data into local storage, I presume that bit is working but it's tricky to tell at the moment.

    I think it needs something to tell it to store the cookie in a file and possibly where that file should be. Any help appreciated before I give up and just start chrome in kiosk mode which isn't ideal!

    Code:
    Dim manager As JavaObject
    manager.InitializeNewInstance(
    "java.net.CookieManager"null)
    Dim handler As JavaObject
    handler.InitializeStatic(
    "java.net.CookieHandler").RunMethod("setDefault"Array(manager))
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Ivan Judd

    Ivan Judd New Member Licensed User

    I've seen that post and looked into it. I had to change so much server code and JavaScript to basically replicate what every browser does out of the box I decided I was just reinventing the wheel and would end up breaking my web app so I've put it on the back burner for the time being.

    Cheers.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice