{"id":68,"date":"2008-10-02T09:15:28","date_gmt":"2008-10-02T16:15:28","guid":{"rendered":"http:\/\/cknotes.com\/?p=68"},"modified":"2008-10-02T09:15:28","modified_gmt":"2008-10-02T16:15:28","slug":"http-cookie-detection-by-server-side-code","status":"publish","type":"post","link":"https:\/\/cknotes.com\/http-cookie-detection-by-server-side-code\/","title":{"rendered":"HTTP Cookie Detection (by server-side code)"},"content":{"rendered":"<p><strong>Question:<\/strong><\/p>\n<p>I spoke to you earlier this morning about a problem I&#8217;m having with<br \/>\nusing the HTTP component, and logging into Amazon. Based on the<br \/>\nresponse I&#8217;m getting I am indeed successfully logging on since it<br \/>\nshows my name at the top of the page. However it shows me an error<br \/>\nmessage about cookies. I do in fact know that we are receiving cookies<br \/>\nsince it created an xml file in the cookies directory as soon as I ran<br \/>\nthe page. Any help you can provide would be greatly<br \/>\nappreciated.<\/p>\n<p><strong>Answer:<\/strong><\/p>\n<p>I did a little research and found that there is no standard way of<br \/>\ndetecting cookies. A typical way sites do it is to check to see if a<br \/>\ncookie was sent with the request. For example, when you initially<br \/>\nbrowse to the login page, you&#8217;ll get a cookie. When you submit the POST<br \/>\n(i.e. when you login) the cookie that came with the initial page load is<br \/>\nsent back, and the presence of this cookie tells the server whether or<br \/>\nnot the browser is supporting cookies. Therefore, w\/ Chilkat you would<br \/>\nwant to first load the URL of the page containing the login form by<br \/>\ncalling QuickGetStr. That should give you the cookie which will<br \/>\nautomatically be sent back with the next HTTP request (assuming<br \/>\nSaveCookies and SendCookies) is turned on&#8230;<\/p>\n<p><strong>Followup:<\/strong><\/p>\n<p>That certainly seems to be what the problem was. I&#8217;ll have to keep that in mind for future deployments. Thanks for the prompt response.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: I spoke to you earlier this morning about a problem I&#8217;m having with using the HTTP component, and logging into Amazon. Based on the response I&#8217;m getting I am indeed successfully logging on since it shows my name at the top of the page. However it shows me an error message about cookies. I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[90,428],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-cookies","tag-http"],"_links":{"self":[{"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":0,"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"wp:attachment":[{"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cknotes.com\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}