Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Difference between client and server side cookie Date: Sun, 13 Mar 2016 11:46:59 +0000 Organization: A noiseless patient Spider Lines: 62 Message-ID: <87oaai7g7g.fsf@bsb.me.uk> References: <87wpp67j6w.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="3137"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bJyf0Q1AvL06tQZsbSNEfK5kXmdciFms=" Cancel-Lock: sha1:PLZg9AZt9o1mENlWHfVm5HYD990= sha1:ryKbdqGGP9VZgji20FUpDo/6wdg= X-BSB-Auth: 1.9fe069693e2da15495cd.20160313114659GMT.87oaai7g7g.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:29958 "Evertjan." writes: > Ben Bacarisse wrote on 13 Mar 2016 in > comp.lang.javascript: > >> "Evertjan." writes: >> >>> Aleksandro wrote on 13 Mar 2016 in >>> comp.lang.javascript: >>> >>>> On 12/03/16 19:32, Evertjan. wrote: >>>>> Stefan Weiss wrote on 12 Mar 2016 in >>>>> comp.lang.javascript: >>>>> >>>>>> Normally, there is no difference. You can read and set cookies on the >>>>>> server and on the client (with JS). >>>>> >>>>> There are no cookies "on the server". >>>> >>>> There are while I am taking care of a request that sent them. >>> >>> Take care, that is nonsense. >>> >>> I even don't understand your sentense. >> >> He's saying that there are sometimes cookies "on the server" -- >> specifically they are sent there every time a client makes a request for >> which a cookie is relevant. Where are they while the server is using >> them if not "on the server"? It's a small point, but it's not wrong. > > No, not "are", cookies only exist where they are stored, and they are stored > only in client/browser memory. The data are stored in both places. You are in fact stipulating that it's not a cookie (in your terms) either in transit or when it is stored on the server. > A request for setting a cookie or a response on reading a cookie is not a > cookie, as then the key/value-combination can and will even be on an > intermediate internet server or in your router memory for a moment, but I > consider that not "are" in the sense of "existing". OK. That's one point of view but then you can't say things like "a cookie is sent to the server in the HTTP request header". The cookie ceases to be a cookie once in transmission. I think that just complicates the way have to talk about these things. >> Where are they while the server is using >> them if not "on the server"? > > No, the server is using ONLY the content of the cookie, the key/value > pair. I think that's unnecessarily fussy and does not match the usage in the RFCs. They refer to "sending cookies" and the one specifically about cookies defines them as a name/value pairs that are passed to the user agent and returned to the server. -- Ben.