Search code examples
httpwebcookieshttpsstate-management

Is the cookie dependent on the browser?


I'm a little confused about the cookie and I want to know can we use cookies somewhere other than the browser, like a mobile app or desktop app. Is the cookie dependent on the browser?


Solution

  • No, cookie is not dependent on browser.

    Cookie is dependent on HTTP "User-Agent" -- the software/library client that is acting on behalf of a user, following HTTP protocol. Browser is just one type of it. Other types of "User-Agent" includes:

    • CLI software that can send HTTP request, such as curl or wget.
    • Library that can be imported in project and send HTTP request. Take Node.js project for example, they can be request or axios. All major programming language have its own HTTP client libraries.
    • Self-implemented HTTP client logic code.
    • more...

    In a mobile app or desktop app, if HTTP is used for application, it is highly likely that cookie is used.