dpepbjp126917 2018-06-03 23:17
浏览 69
已采纳

TCP协议是否也像HTTP协议那样处理cookie?

I am planning to use php socket for my project. It needs user login to populate the content based on the session. So my question is that TCP/IP protocol also send/receive cookies for each and every request as HTTP protocol do or no i have to implement cookies system by myself. My project is not dependent on browser, it is like an application that will communicate through socket.

Can anyone explain in easy words?

Thanks in advance.

  • 写回答

3条回答 默认 最新

  • douqi1212 2018-06-04 00:03
    关注

    So my question is that TCP/IP protocol also send/receive cookies for each and every request as HTTP protocol do

    No. Cookies are defined by the HTTP protocol. Some other protocols have similar concepts, but there is nothing equivalent in TCP itself. TCP doesn't really have a concept of a "request" either; there is only a connection, and data flowing across it.

    (TCP does have a feature known as SYN cookies, but this is completely unrelated to HTTP cookies.)

    You may want to consider using the WebSockets protocol. WebSockets runs over HTTP, and as such can take advantage of some features of HTTP, including cookies.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?