TCefRequestRef synchronous cookies
Posted: Thu Mar 29, 2018 3:33 am
Hi,
I use TCefRequestRef like this:
Request := TCefRequestRef.New;
Request.Url := BaseURL + '/oauth-provider/api/login';
Request.Method := 'POST';
Header := TCefStringMultimapOwn.Create;
Header.Append('Accept', 'application/json, text/javascript, */*; q=0.01');
Header.Append('X-Requested-With', 'XMLHttpRequest');
Header.Append('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36');
Header.Append('Content-Type', 'application/x-www-form-urlencoded');
Header.Append('Accept-Encoding', 'gzip, deflate');
Header.Append('Accept-Language', 'en-US,en;q=0.9');
Request.SetHeaderMap(Header);
Data := TCefPostDataRef.New;
Request.PostData := Data;
Request.SetReferrer(BaseURL, REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE);
chrm1.Browser.MainFrame.LoadRequest(Request);
It is found that cookie is not synchronized with mainframe,How do I deal with this problem
I use TCefRequestRef like this:
Request := TCefRequestRef.New;
Request.Url := BaseURL + '/oauth-provider/api/login';
Request.Method := 'POST';
Header := TCefStringMultimapOwn.Create;
Header.Append('Accept', 'application/json, text/javascript, */*; q=0.01');
Header.Append('X-Requested-With', 'XMLHttpRequest');
Header.Append('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36');
Header.Append('Content-Type', 'application/x-www-form-urlencoded');
Header.Append('Accept-Encoding', 'gzip, deflate');
Header.Append('Accept-Language', 'en-US,en;q=0.9');
Request.SetHeaderMap(Header);
Data := TCefPostDataRef.New;
Request.PostData := Data;
Request.SetReferrer(BaseURL, REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE);
chrm1.Browser.MainFrame.LoadRequest(Request);
It is found that cookie is not synchronized with mainframe,How do I deal with this problem