How to delete jsessionid cookie in javascript

Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

View, edit, and delete cookies

  • Article
  • 09/13/2022
  • 2 minutes to read

In this article

HTTP cookies are used to manage user sessions, store user personalization preferences, and track user behavior. Use the Cookies pane of the Application tool to view, edit, and delete the HTTP cookies for a webpage.

See Using HTTP cookies.

Open the Cookies pane

  1. Open DevTools on the webpage you want to edit. For example, right-click the page and then select Inspect, or press F12. For additional ways, see Open DevTools.

  2. Click the Application tab to open the Application tool. The Manifest pane opens:

    How to delete jsessionid cookie in javascript

  3. Under Storage, expand Cookies, then select an origin:

    How to delete jsessionid cookie in javascript

Fields

The Cookies table contains the following fields:

  • Name. The name of the cookie.

  • Value. The value of the cookie.

  • Domain. The hosts that are allowed to receive the cookie. See Scope of cookies.

  • Path. The URL that must exist in the requested URL in order to send the Cookie header. See Scope of cookies.

  • Expires / Max-Age. The expiration date or maximum age of the cookie. See Permanent cookies. For session cookies this value is always Session.

  • Size. The size, in bytes, of the cookie.

  • HttpOnly. If true, this field indicates that the cookie should only be used over HTTP, and JavaScript modification isn't allowed. See HttpOnly cookies.

  • Secure. If true, this field indicates that the cookie must be sent to the server only over a secure, HTTPS connection. See Secure cookies.

  • SameSite. Contains strict or lax if the cookie is using the experimental Samesite attribute.

  • SameParty. This attribute provides web developers a means to annotate cookies that are allowed to be set or sent in same-party, cross-site contexts.

  • Partition Key. A partition key is a property or path within a document that can be used to distribute data within a document yet store the data together. Multiple pieces of data that are spread throughout a document and that have the same partition key value are logically grouped together and stored in the same physical partition.

  • Priority. Contains low, medium (default), or high if the cookie is using the deprecated Cookie Priority attribute.

Filter cookies

To filter cookies by Name or Value, use the Filter text box:

How to delete jsessionid cookie in javascript

Note: Filtering by other fields isn't supported.

The Name, Value, Domain, Path, and Expires / Max-Age fields are editable. Double-click a field to edit it:

How to delete jsessionid cookie in javascript

Delete cookies

To delete a specific cookie, click a cookie and then click Delete Selected (

How to delete jsessionid cookie in javascript
):

How to delete jsessionid cookie in javascript

To delete all cookies, click Clear all cookies (

How to delete jsessionid cookie in javascript
):

How to delete jsessionid cookie in javascript

How to delete jsessionid cookie in javascript
This work is licensed under a Creative Commons Attribution 4.0 International License.

Feedback

Submit and view feedback for

Delete a Cookie with JavaScript Just set the expires parameter to a past date: document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; You should define the cookie path to ensure that you delete the right cookie. Some browsers will not let you delete a cookie if you don't specify the path.
Note that a cookie created via HTTP with the httponly attribute cannot be deleted using the JavaScript API.
Clear all cookies.
On your computer, open Chrome ..
At the top right, click More Settings ..
Click Privacy and security. Cookies and other site data..
Click See all site data and permissions. Clear all data..
To confirm, click Clear..

How do I clear the cookies in react JS?

Cookies can be removed in React. js by using the following methods: By using cookies. remove() in the react-cookie library.