英文:
How do i read httponly cookies with webview_flutter package, or intercept all the response with it?
问题
我正在使用webview_flutter包开发一个Flutter应用,遇到了一些与Cookie相关的问题。我想要获取HttpOnly Cookie,并在我的Flutter应用中处理该Cookie。但由于该Cookie是HttpOnly的,我无法获取它。那么,如何通过我的WebView获取该Cookie?或者是否可以监听当前URL头部的内容?
英文:
i'm developing a flutter app with webview_flutter package and have several problem with the cookies. I want to get httponly cookie with it, then proces the cookie inside my flutter app. But, because the cookie is http only, i can't get that. So, how to get the cookie via my webview? or can i listen what is in the header of my current url?
答案1
得分: 0
没办法通过evaluate JavaScript读取HTTP Only cookie,唯一的方法是手动调用API(比如登录),然后将cookie保存在全局状态或本地存储中。
问题解决。
英文:
There's no way to read HTTP Only cookie from evaluate JavaScript, the only way to read the cookie is manually hit the API(ex: login) then save the cookie inside a global state or save it locally to your local storage.
Case solved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论