WebView.AllCookies
------------------

Returns all website cookies as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [8.4](newinversion84.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.AllCookies"; WebViewerRef ) 

**MBS**( **"WebView.AllCookies";** /\* Returns all website cookies as JSON. \*/  
**$WebViewerRef**) /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |

### Result

Returns OK or error.

### Description

Returns all website cookies as JSON.  
For WebKit 1.x, this returns global list of cookies.  
  
For WebKit 2.x, this returns list of cookies associated to the web viewer, which may be a persistent list. For WebKit 2.x we need MacOS 10.13 or iOS 11.0 to work.  
  
Windows support added for version 13.1. JSON objects have objects with name, domain, value, path, sessionOnly, HTTPOnly and expires with the time value in seconds. e.g. use TimeStamp ( Date ( 1 ; 1 ; 1970 ); Time ( 0; 0; 0 )) + $expires to calculate final timestamp on Windows.  
  
We added expires for macOS to have same value available.  
### Examples

Get all cookies:

 Set Field \[ WebView SelectedText::Cookies ; MBS ("Webview.AllCookies"; "web") \]  
<small>  
Example result:   
\[ { "domain" : "www.filemaker.com" , "secure" : false, "HTTPOnly" : false, "commentURL" : null, "portList" : \[ \], "expiresDate" : "2027-11-03 21:43:00 +0000" , "value" : "192.123.25.13.123456789" , "path" : "\\/" , "comment" : null, "name" : "fmi\_cookie" , "sessionOnly" : false } \] </small>### See also

- [WebView.FindByName](WebViewFindByName.md)

### Release notes

- **Version 13.1**
    - Deprecated [WebView.Cookies.Count](https://www.mbsplugins.eu/WebViewCookiesCount.shtml) and [WebView.Cookies.Query](https://www.mbsplugins.eu/WebViewCookiesQuery.shtml) in favor of [WebView.AllCookies](https://www.mbsplugins.eu/WebViewAllCookies.shtml) function.
    - Implemented [WebView.AllCookies](https://www.mbsplugins.eu/WebViewAllCookies.shtml) and [WebView.PrintToFile](https://www.mbsplugins.eu/WebViewPrintToFile.shtml) for Windows.
- **Version 12.0**
    - Fixed problem in [WebView.AllCookies](https://www.mbsplugins.eu/WebViewAllCookies.shtml) with NULL values.
- **Version 8.4**
    - Added [Webview.AllCookies](http://www.mbsplugins.eu/WebviewAllCookies.shtml) function to return all website cookies as JSON.

### Blog Entries

- [Neues MBS Plugin 13.1 für Claris FileMaker](https://www.mbsplugins.de/archive/2023-03-07/Neues_MBS_Plugin_131_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.1 for Claris FileMaker](https://www.mbsplugins.de/archive/2023-03-07/MBS_Plugin_131_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.1pr4](https://www.mbsplugins.de/archive/2023-02-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.6pr4](https://www.mbsplugins.de/archive/2021-12-22/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.4pr3](https://www.mbsplugins.de/archive/2018-08-16/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st August 2018 , last changed 23th February 2023

  
[WebView.AddUserScript](WebViewAddUserScript.md) - [WebView.AllowsAnyHTTPSCertificateForHost](WebViewAllowsAnyHTTPSCertificateForHost.md)

[HTML Version](WebviewAllCookies.shtml)