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条)

报告相同问题?

悬赏问题

  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程