{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/10506","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/10506/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/10506/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/10506/events","html_url":"https://github.com/edx/edx-platform/pull/10506","id":115036264,"number":10506,"title":"set path explicitly for storing cookie","user":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-11-04T11:50:37Z","updated_at":"2015-12-15T08:09:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10506","html_url":"https://github.com/edx/edx-platform/pull/10506","diff_url":"https://github.com/edx/edx-platform/pull/10506.diff","patch_url":"https://github.com/edx/edx-platform/pull/10506.patch"},"body":"[TNL-2622](https://openedx.atlassian.net/browse/TNL-2622)\r\n\r\n**Problem**:\r\nThe jquery cookie plugin stored the cookie with default path up-to last forward slash of url for example\r\n1) Mongo Course Url:  ```/import/edX/edX_01/2015_edX```\r\n2) Split Course Url: ```/import/course-v1:edX+edX_01+2015_edX```\r\nSo the for mongo the stored path of cookie will be ```/import/edX/edX_01/```(fine) and for the split courses the url will be same for all that will be ```/import/``` so when ever we goto un-imported split course it will show that it is already imported if at least one of the split course is imported.\r\n\r\n**Solution**:\r\n\r\nWe can set the ```path``` explicitly for cookie using jquery plugin  [here](https://github.com/carhartl/jquery-cookie#path) so in this way the ```path``` will store with full url and while reading the cookie it will pick up the correct cookie .This will help to prevent the above problem but what about already stored cookies on client machines ? so as we already saving the file url [here](https://github.com/edx/edx-platform/blob/062e979e0ed14161d0f882091a06e032ca76bb3e/cms/static/js/views/import.js#L307) which contains the url of course and solution for this problem the idea is to get fetch all the cookies of domain and then filtered the cookies which have the course url in file url."},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/164679871","html_url":"https://github.com/edx/edx-platform/pull/10506#issuecomment-164679871","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10506","id":164679871,"user":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T08:09:11Z","updated_at":"2015-12-15T08:09:11Z","body":"jenkins run lettuce"}}