In the request body, supply only the values for properties that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
Property
Type
Description
comment
String
The comment of the cookie.
displayName
String
The name of the cookie.
hostOnly
Boolean
Determines whether a cookie is a host-only or domain cookie.
hostOrDomain
String
The URL of the cookie.
path
String
The path of the cookie.
sourceEnvironment
browserSharedCookieSourceEnvironment
Specifies how the cookies are shared between Microsoft Edge and Internet Explorer. The possible values are: microsoftEdge, internetExplorer11, both, unknownFutureValue.
Response
If successful, this method returns a 204 No Content response code.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new BrowserSharedCookie
{
HostOrDomain = "www.microsoft.com",
SourceEnvironment = BrowserSharedCookieSourceEnvironment.MicrosoftEdge,
DisplayName = "Microsoft Cookie",
Path = "/",
HostOnly = true,
Comment = "Updating source environment.",
};
var result = await graphClient.Admin.Edge.InternetExplorerMode.SiteLists["{browserSiteList-id}"].SharedCookies["{browserSharedCookie-id}"].PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BrowserSharedCookie();
$requestBody->setHostOrDomain('www.microsoft.com');
$requestBody->setSourceEnvironment(new BrowserSharedCookieSourceEnvironment('microsoftEdge'));
$requestBody->setDisplayName('Microsoft Cookie');
$requestBody->setPath('/');
$requestBody->setHostOnly(true);
$requestBody->setComment('Updating source environment.');
$result = $graphServiceClient->admin()->edge()->internetExplorerMode()->siteLists()->byBrowserSiteListId('browserSiteList-id')->sharedCookies()->byBrowserSharedCookieId('browserSharedCookie-id')->patch($requestBody)->wait();