News for hackers. Stuff that matters.
Re:Does “www.” Mean Better Transport Layer Security? by uberswe on Monday August 19, 2019 @03:59AM (#20735810)
www is more secure to use than the root domain because of how cookies are set. Setting a cookie for the www subdomain ensures that it’s only available for that subdomain and not globally across all subdomains. It makes sense that sites that use www are generally more secure.
Re:Does “www.” Mean Better Transport Layer Security? by numlock86 on Monday August 19, 2019 @05:15AM (#20736171)
> www is more secure to use than the root domain because of how cookies are set.

> Setting a cookie for the www subdomain ensures that it’s only available for that subdomain and not globally across all subdomains.

No, www is not more secure because of cookies. As you said, it depends on how cookies are set, which is up to the host, as this is defined in the HTTP headers coming from the server. It's possible to access a cookie from "www.example.com" on "example.com" or "sub.example.com" if it's configured like that on the backend. Also the browser needs to comply. (Protip: most browsers do)

Re:Does “www.” Mean Better Transport Layer Security? by snowwrestler on Monday August 19, 2019 @08:10AM (#20737025)
> It's possible to access a cookie from "www.example.com" on "example.com" or "sub.example.com" if it's configured like that on the backend.

Ok but to my knowledge it is impossible to set a cookie on example.com and make it inaccessible to subdomain.example.com.

Re:Does “www.” Mean Better Transport Layer Security? by megous on Monday August 19, 2019 @09:45AM (#20737670)
That's not true at all.

Try document.cookie = 'a=b' in a browser console on non-www domain and then do document.cookie on the www variant.

You'll see it not set. (The cookie will only be accessible on subdomains if you include the domain explicitly, like document.cookie = 'a=b;domain=toplevel.domain')

Re:Does “www.” Mean Better Transport Layer Security? by Jwarder on Monday August 19, 2019 @11:30AM (#20738620)
My understanding that doesn't work on old versions of IE.
Re:Does “www.” Mean Better Transport Layer Security? by will4274 on Monday August 19, 2019 @11:56AM (#20738871)
Yeah, because the WHATWG folks changed the spec after 20 years. Not because IE implemented the wrong thing. Not surprising folks in this thread remember the old spec, which was valid for longer.
Re:Does “www.” Mean Better Transport Layer Security? by megous on Monday August 19, 2019 @12:01PM (#20738917)
True, not even IE11.
Re:Does “www.” Mean Better Transport Layer Security? by type0 on Monday August 19, 2019 @09:13AM (#20737409)
It's not a bug, it's a feature /s
Re:Does “www.” Mean Better Transport Layer Security? by robocat on Monday August 19, 2019 @04:07AM (#20735849)
Note that by default Google analytics puts the cookies on the root domain, and you need to change the JavaScript snippet to avoid that.

Cloudflare also puts cookies on the root domain.

I definitely agree though.

Re:Does “www.” Mean Better Transport Layer Security? by megous on Monday August 19, 2019 @09:51AM (#20737717)
You can set cookies in a way that they are only accessible on the top domain.