wheelmap-classic icon indicating copy to clipboard operation
wheelmap-classic copied to clipboard

Widget: Cookies override location settings in widget

Open thermann78 opened this issue 8 years ago • 10 comments

Hey there,

I just found out that the widget shows the last location from my visit on wheelmap.org instead of the widget default location. Could we try to fix this? Short example:

  1. I visit http://travelable.info/infoseiten/sylt/ and have a look at the widget below
  2. I expect the widget to show the geographic region of Sylt as defined within the widget settings
  3. Instead I see a high-level zoom on Eldenaer Str. in Berlin where I have been before on wheelmap.org/map.

A fix would be really helpful for people that are actually using the wheelmap and visiting other websites with the embedded widget.

thermann78 avatar Nov 09 '16 12:11 thermann78

I am unable to reproduce this issue in Firefox.

Steps taken:

  • Visit http://travelable.info/infoseiten/sylt/
  • Click some things on the map.
  • Visit https://wheelmap.org/map
  • Drag the map around a bit until I get a URL like https://wheelmap.org/map#/popup/1288091305?lat=52.50812429253185&lon=13.186683654785156&zoom=14
  • Click on a couple nodes (Like https://wheelmap.org/map#/popup/268917494?lat=52.52828459906009&lon=13.186683654785156&zoom=14 and https://wheelmap.org/map#/popup/1885599514?lat=52.52828459906009&lon=13.186683654785156&zoom=14)
  • I navigate to http://travelable.info/infoseiten/sylt/ again and see the correct area
screen shot 2017-01-19 at 10 22 46

Please confirm this is still an issue!

Hoverbear avatar Jan 19 '17 09:01 Hoverbear

@thermann78 cc @Svenyo

Can you please specify a) if this ticket is still valid? b) what browser you were using?

1000miles avatar Feb 07 '17 09:02 1000miles

@1000miles yes, prob still exists. Tried with Safari 10.0.1 on OS X.

thermann78 avatar Feb 07 '17 10:02 thermann78

I am also not able to reproduce this. I tried the steps @Hoverbear described in both Chrome 56 and Safari 10.0.2 on macOS Sierra.

schultyy avatar Mar 01 '17 13:03 schultyy

@thermann78 can you elaborate on this? Eg. are you logged in and is it possible that your account is the same as the one used for the travelable widget (API token)?

holgerd avatar Mar 14 '17 08:03 holgerd

Nope, problem persists. I'm not logged in. Tried again:

  1. Did a search on Wheelmap.org für "Tübingen".
  2. Opened http://travelable.info/infoseiten/sylt/
  3. Saw the surroundings of Tübingen in the widget.

No login, even API key is not from my personal account but from an account I registered exclusively for the purpose of creating widget code.

thermann78 avatar Mar 14 '17 09:03 thermann78

@thermann78 thanks. Hmm I still can't reproduce this. Can you try again and delete your wheelmap cookies beforehand (or try in inkognito mode)?

holgerd avatar Mar 14 '17 11:03 holgerd

It works correctly in incognito mode. So it is backing my theses that the widget is using cookies from the map which include the last coordinates. If so, this wouldn't make too much sense as the widget is primarily considered to show the location defined within the embed code instead of the last location searched for on Wheelmap.

thermann78 avatar Mar 14 '17 12:03 thermann78

Still unable to reproduce this after following @thermann78's steps:

screen shot 2017-03-29 at 14 03 22 screen shot 2017-03-29 at 14 03 28

Hoverbear avatar Mar 29 '17 12:03 Hoverbear

I noted the following:

We explicitly avoid setting anything in the cookie when the map is moved and we are using a widget. (https://github.com/sozialhelden/wheelmap/blob/master/app/assets/javascripts/controllers/map.controller.js.coffee#L211)

Looking at the controller for the map (https://github.com/sozialhelden/wheelmap/blob/master/app/assets/javascripts/controllers/map.controller.js.coffee#L130-L142) we can see that the code does not read from the cookie, it just reads from the query string ?bbox=... attribute in the URL:

<iframe src="//wheelmap.org/embed/asMbikXCBLzj4NKV6dUB#/?bbox=55.0583511,54.7418629,8.2788526,8.489955" height="400" width="500"></iframe>

Hoverbear avatar Mar 29 '17 12:03 Hoverbear