efronbs / ProfileSharing

0 stars 0 forks source link

(TEST THE FIX) Handle leading period in cookie domain name. #12

Closed efronbs closed 7 years ago

efronbs commented 7 years ago

Currently I am organizing everything by domain name. This gets populated by gathering the browser cookies. Some cookies will have a leading period to signify that those cookies should be readable by subdomains. I the past I didn't handle this because requiring a leading period is deprecated behavior, so it didn't matter whether I tracked that or not.

I want to keep local storage under the same domain section in the profile JSON (whether I am storing actual data or just using it as a lookup for a database). However when parsing a url to do a lookup for local storage, it is impossible to know whether the key for that domain will have a leading period or not. I need to find a way to handle this.

Current options are:

  1. Remove leading period when fetching all browser cookies. This is probably the best option. I don't think the website needs to know whether the domain has a leading period or not when getting or setting cookies, so I think that I can safely remove a leading zero if it exists. This would also simplify logic elsewhere
  2. If option 1 doesn't work I can always send a domain without a leading zero, and the try fetching both. This is messy and less preferable, but it should work.
efronbs commented 7 years ago

Implemented option 1. Need to fully test it. Will do that after implementing local storage logic.

I don't know why I spent so much time writing a detailed issue for such a simple bug.

efronbs commented 7 years ago

Not an issue anymore because of new profile format.