Bug 144019 - WKWebView loses cookies when deallocated
Summary: WKWebView loses cookies when deallocated
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All iOS 8.2
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-21 15:46 PDT by Shreyas VA
Modified: 2015-06-12 13:52 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shreyas VA 2015-04-21 15:46:52 PDT
When a WKWebView is deallocated it loses cookies. On the next instantiation it does not retain all the cookies from the previous browsing session.

This is problematic because WKWebViews can be deallocated at any time during the app's lifecycle and this will result in a loss of cookies.
UIWebView does not suffer from this problem.

Steps to Reproduce:
1) Allocated a WKWebView using [[WKWebView alloc] init]
2) navigate to "http://www.html-kit.com/tools/cookietester/"
3) Set a test cookie by clicking on “Set Test Cookie”
4) Wait for the page to refresh and reflect that a cookie has been set
5) Deallocate the WKWebViewView
6) Allocate a new WKWebView and navigate to the same site

Expected Results:
Cookies should not be lost between different instances of a WKWebView.

Actual Results:
Cookies are lost.

Version:
iOS8.3

Notes:
GOOGLER:shreyasv

Configuration:
Any iOS devices.
Comment 1 Shreyas VA 2015-04-21 15:47:15 PDT
rdar://20558665
Comment 2 Stefan Arentz 2015-05-12 06:45:12 PDT
Does this also happen when you configure a WKProcessPool? I think that slightly changes the behaviour of web site data synchronization.
Comment 3 Shreyas VA 2015-06-12 13:52:11 PDT
Can you add more detail on what you mean by configuring a WKProcessPool?
If you mean setting a different WKProcessPool on the WKWebViewConfiguration, then yes this bug repros even on that.