ARC Documentation
Install ARCGitHub projectTwitter
  • Getting started
  • Installation
  • Moving From Chrome Application To Desktop Client
  • Privacy
  • Using ARC
    • Sending requests
      • Body editor
      • Authorizing a request
      • Request editor options
    • Environments and variables
    • Host rules
    • Request actions
    • Cookies and session management
    • Workspaces
    • HTTP Requests History
    • Saved requests
    • ARC (legacy) projects
    • Searching for requests
    • Automated API documentation
    • HTTP Proxy
    • Frequently asked questions
    • Application auto update
  • Guides
    • Authenticating With OAuth2 And Request Actions
  • API School
    • Web APIs basics
    • RESTful APIs getting started
  • ARC Actions
    • Introduction
      • Set variable action
      • Set cookie action
      • Remove cookie(s) action
  • ARC development
    • Git branches
    • Architecture
Powered by GitBook
On this page
  • Introduction video
  • Authenticating to a web service
  • Creating cookies manually

Was this helpful?

  1. Using ARC

Cookies and session management

Cookies are an important part of the session mechanism in the web and when working with APIs. This section describes how to use cookie manager to authenticate the request using cookies.

PreviousRequest actionsNextWorkspaces

Last updated 3 years ago

Was this helpful?

Introduction video

When possible, use other means to authenticate a request like Bearer token with JWT.

The "set-cookie" header tells the client (web browser, ARC) that the server requests to store some data on the client. This data should be then sent back with any following request that matches the set domain and path.

ARC is a web-based application and it has a browser included in it. To leverage this ARC allows you to open a Chromium browser window (it is an open-source version of Chrome), log in to a web service, and store received this way cookies into ARC storage. The window opened in ARC has a separate storage and session management than any other ARC window (main application, menu popup window, task manager, and so on). This way you can securely authenticate in the window and only incoming cookies are sent back to the application ignoring any other stored values.

Authenticating to a web service

To obtain and store cookies by logging in to a web service using a browser window select Request > Web Session > Login to a web service menu option. This opens an URL input where you can put the login page URL.

In this example we will use MuleSoft's Anypoint platform login scheme. The login page is accessible under https://anypoint.mulesoft.com URL.

After a successful login, a regular page is rendered.

Now the login window can be closed. All cookies sent by the authorization server are now synchronized with ARC's cookies manager. You can see the cookies by selecting the Request > Web session > Cookie Manager menu option.

When a request to a matching domain is executed the cookies are automatically added to the request.

Creating cookies manually

In Cookie manager (Request > Web session > Cookie manager) you have an option to create a cookie manually or to edit existing cookie. I am going to create a new cookie that is going to be set to a request send to domain.com.

After saving the cookie a new entry is added to the list of cookies.

You can preview cookie details or edit the cookie after pressing the "details" button next to the cookie name.

After a cookie is set it will be automatically added to a request that matches the domain domain.com.

Because the cookie was created with dot "." in front of the cookie domain, the cookie is applied to all requests sent to the domain and all its subdomains. This means the request to the domain http://www.domain.com will also have the cookie applied to it.

Advanced REST Client emulates browser behavior when it comes to handling cookies. When a set-cookie header is received as a response to an API call then the value of the cookie is processed according to specification. When a request is made to the cookie domain after the cookie was received it is automatically added to the request.

HTTP State Management Mechanism
Session management introduction video
Login to a web service URL input
Login page to Anypoint platform
Authorized user view
Cookies set by the web service
Request with cookies added automatically
Cookie editor with values
Created cookie on the list of cookies
Cookie details
Request with cookie