All Projects → CWBudde → cordova-plugin-wkwebview-inject-cookie

CWBudde / cordova-plugin-wkwebview-inject-cookie

Licence: Apache-2.0 License
Injects a cookie in order to start the sync processs with wkWebView

Programming Languages

objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cordova-plugin-wkwebview-inject-cookie

Wkcookiewebview
WKWebView with cookie sharing support
Stars: ✭ 171 (+297.67%)
Mutual labels:  cookie, wkwebview
Kkjsbridge
一站式解决 WKWebView 支持离线包,Ajax/Fetch 请求,表单请求和 Cookie 同步的问题 (基于 Ajax Hook,Fetch Hook 和 Cookie Hook)
Stars: ✭ 462 (+974.42%)
Mutual labels:  cookie, wkwebview
ngx-scroll-to-first-invalid
Directive to scroll to first invalid form control inside an Angular form on submit
Stars: ✭ 27 (-37.21%)
Mutual labels:  first
nestjs-cookie-session
Idiomatic Cookie Session Module for NestJS. Built on top of `cookie-session` 😻
Stars: ✭ 35 (-18.6%)
Mutual labels:  cookie
NbInjection
PoC for inject zygote process by replacing system native bridge support
Stars: ✭ 70 (+62.79%)
Mutual labels:  inject
CrashLogger
A dll injected into process to dump stack when crashing.
Stars: ✭ 19 (-55.81%)
Mutual labels:  inject
simple-cookie
A very simple, super lightweight javascript cookie class that you will understand.
Stars: ✭ 17 (-60.47%)
Mutual labels:  cookie
yii2-cookiemonster
Yii extension to manage cookie warning
Stars: ✭ 16 (-62.79%)
Mutual labels:  cookie
Zebra Cookie
A ridiculously small (~500 bytes minified) JavaScript API for writing, reading and deleting browser cookies
Stars: ✭ 15 (-65.12%)
Mutual labels:  cookie
summary1
个人总结 持续更新 欢迎提出各种issues
Stars: ✭ 13 (-69.77%)
Mutual labels:  cookie
javascript-cookie-control
Javascript module for controling cookie consent on your website
Stars: ✭ 18 (-58.14%)
Mutual labels:  cookie
QWWebViewFullScreenPopGesture
An WKWebView's category to enable fullscreen pop gesture in an iOS8+ system style with AOP.
Stars: ✭ 32 (-25.58%)
Mutual labels:  wkwebview
nginx cookie flag module
Module for Nginx which allows to set the flags "HttpOnly", "secure" and "SameSite" for cookies.
Stars: ✭ 101 (+134.88%)
Mutual labels:  cookie
CockyGrabber
C# library for the collection of browser information such as cookies, logins, and more
Stars: ✭ 46 (+6.98%)
Mutual labels:  cookie
contao-cookiebar
Display the information about cookies on your Contao website
Stars: ✭ 27 (-37.21%)
Mutual labels:  cookie
svelte-persistent-store
A Svelte store that keep its value through pages and reloads
Stars: ✭ 111 (+158.14%)
Mutual labels:  cookie
nuxt-mail
Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
Stars: ✭ 62 (+44.19%)
Mutual labels:  inject
next-fauna-auth
Implemented cookie-based user authentication in a Next.js, FaunaDB and GraphQL app
Stars: ✭ 29 (-32.56%)
Mutual labels:  cookie
gloation
A badass notion theme. Name inspired by the words glass and notion
Stars: ✭ 23 (-46.51%)
Mutual labels:  inject
node-fetch-cookies
node-fetch wrapper that adds support for cookie-jars
Stars: ✭ 15 (-65.12%)
Mutual labels:  cookie

cordova-plugin-wkwebview-inject-cookie

When switching to wkWebView in Cordova for iOS some plugins have the known issue that cookies won't be used properly on the very first start of the application, or every time using the iOS Simulator. In particular session cookies. This is due to a missing proper sync between the underlying WKHTTPCookieStore and the WebView.

While this issue could probably only get fixed by Apple in the first place, there is a simple workaround available to get it working: Once a dummy cookie is placed into the WKHTTPCookieStore manually, the syncronization gets triggered (started) and it won't bug you ever again.

Unfortunately this only works for iOS11 and it's necessary to supply the specific domain. This means the solution does not work out of the box. At least some interaction is necessary.

Usage

document.addEventListener('deviceready', () => {
  wkWebView.injectCookie('mydomain.com', 'mypath');
});

You have to replace "mydomain.com" with your domain name and "mypath" with your subpath. If the latter is empty than you don't need to provide it (just leave the trailing slash there to tell the plugin that you don't use any extra path).

Once you have injected a cookie all further (session) cookies are synced properly.

If you want you could also pass a success and and error handler. The success handler will be called if the cookie was injected properly, the error handler if not.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].