

In your example, I cannot write to your okie, but I can still steal your cookie and post it to my domain using the XMLHttpRequest object. You need some method for identifying the user behind each request, and cookies are almost always the means to that end.

However, if you want to provide security for AJAX enabled functionality, then the same rules apply as with traditional sites. XmlHttpRequest support (or even iframe remoting, on older browsers) is all that is technically required. More generally, cookies are not required for AJAX. I don't know the implementation details of the Stack Overflow authentication provider, but that cookie data is probably automatically used to verify your identity at a lower level than the "vote" controller method. In the case of Stack Overflow, the cookies are automatically provided as part of the XmlHttpRequest request. They will still be provided with the XmlHttpRequest's request to the server. That’s it! You can now send requests which use these headers.Yes, HTTP-Only cookies would be fine for this functionality. Once it’s installed, click on the icon again in the Postman app and toggle it on.
POSTMAN INTERCEPTOR HEADER INSTALL
POSTMAN INTERCEPTOR HEADER CODE
We have open-sourced Interceptor and you can find the code on Github. Note on security: The only entity that the Interceptor communicates with is Postman which then saves it to your history.

Browse your app or your website and monitor the requests as they stream in.Open Postman, and click on the Interceptor icon in the toolbar to switch the toggle to “on”.Install Postman from the Chrome Web Store, if you don’t have it already.It can also capture and manipulate cookies or set certain HTTP headers that are blocked on the Chrome platform by default. The Postman Chrome app can be used in tandem with the Postman Interceptor extension to make and capture requests. If you have a web app for which you don’t have a collection built already, or you just want to debug the APIs that your app is using, this can save a lot of time. You can filter requests according to the URL based on a regular expression. There are no code changes required either. There is no need to install or configure a proxy. The web server returns a response directly to the Chrome browser.The Interceptor is listening for any calls made by the Chrome browser and captures the request, forwards the request onward, and also sends the request to Postman.The Chrome browser is the client that sends a request to the web server which is INTERCEPTED by the Postman Interceptor.This means you can debug your web apps APIs in real time!

It can capture network requests directly from Chrome and save them to Postman’s history. Postman Interceptor is a Chrome extension that functions as a proxy to capture HTTP or HTTPS requests. Interceptor extension What is Interceptor
