Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
QuakeLive

Value Vs Cookie Value

Recommended Posts

Hi,

 

Here are two quotes from Creating Cookie Library example:

 

 

Begin looping through the cookies:

 

for (var i = 0, count = cookies.length; i < count; i++) {
                var value = (cookies.slice(0,1) == ‘ ‘) ? cookies.slice(1) : cookies;

 

... some browsers add a space in between the cookie values in document.cookie.

 

Decode the value:

 

value = decodeURIComponent(value);

 

 

Would not it be better if instead of "cookie values" we use just "cookies" (... some browsers add a space in between the cookies in document.cookie. )

 

and

 

"Decode the cookie" instead of "Decode the value"?

 

Is it correct to say that "some browsers add a space in between the cookies in document.cookie" INSTEAD OF "some browsers add a space in between the cookie values in document.cookie" ???

 

Thank you in advance!

 

Share this post


Link to post
Share on other sites

I dunno. I think those are rather minor differences. But if you like it your way, that's fine, too.

Thanks. I think that using "Cookies" instead of "Cookie values" is more correct (in the quotes above), because "cookie value" is just a part of the cookie (name-value, duration... )... but not sure, and it does not seem so important... Anyway, thank you again!

Share this post


Link to post
Share on other sites

QuakeLive, I have to agree with Larry on this one that you're splitting semantic hairs. I don't think it really matters one way versus the other, as they mean the same thing.

Of course, your argument that a single cookie string is a name-value combination is valid, but still, I think that context more often than not clears up any ambiguity about what "cookie value" is referring to.

  • Upvote 1

Share this post


Link to post
Share on other sites

At the beginning, I thought that I didn't understand some things about cookies well and that's why I asked:

 

Is it correct to say that "some browsers add a space in between the cookies in document.cookie" INSTEAD OF "some browsers add a space in between the cookie values in document.cookie" ???

 

After that, I just gave my opinion, "splitting semantic-hairs" (or some kind of provocation by trying to find someone else's mistake) was not my intention.

 

Anyway, now it is clear, thank you very much HartleySan and Larry!

Share this post


Link to post
Share on other sites

I knew you weren't trying to point out someone's mistakes, but if you go back and read your original post, I think you might see that your tone was a bit confusing and somewhat implied that.

 

Anyway, I don't think it's a big deal. I just personally think that "cookie value" can mean several things, and the context always clears things up.

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...