To send cookies to the server, you need to add the "Cookie: name=value" header to your request. To send multiple Cookies in one cookie header, you can separate them with semicolons. In this Send Cookies Example, we send HTTP cookies in the request header to the Reqbin echo URL. Click Send to execute "Send Cookies" online and see the results. The Curl/Bash code was automatically generated for the Send Cookies example.
The Hypertext Transfer Protocol is the data transfer protocol that underlies the World Wide Web. HTTP transfers data between HTTP clients (browsers and mobile apps) and servers. HTTP is based on a client-server architecture. HTTP works as a request-response protocol between client and server. The client sends a request and initiates a connection, and the server receives the request, then executes it and sends the result to the client.
What is Cookie?
HTTP Сookies are small pieces of text data sent by a website and stored on a user's computer by a web browser. The data stored in the cookie is created by the server when you connect. This data is tagged with an identifier that is unique to you and your computer. When your computer and the network server exchange cookies, the server reads the identifier and knows what information to give you specifically. The browser sends cookies back to the server with each subsequent request, allowing the server to determine if the request came from the same browser or not. Cookies are primarily used to manage user sessions, track users and personalize (store user preferences and site settings).
Cookies are mainly used for three purposes:
Session management: Logins, passwords, or whatever the server needs to remember
Personalization: Custom settings, themes, and other settings
Tracking: Recording and analysis of user behavior
How to see saved Cookies in the browser?
To see saved Cookies in your browser:
Press F12 to open the developer tool;
Click the Application tab;
In the tree in the Storage section, select Cookies and your website address;
Here, you will see all the Cookies stored for your browser for this site.
How to send Cookies?
An example of sending Cookies header to the ReqBin echo URL:
Send Cookies Example
GET /echo HTTP/1.1
Cookie: name=value; name2=value2