Note that there are some explanatory texts on larger screens.

plurals
  1. POchrome changing cookie path
    primarykey
    data
    text
    <p>I have a web application (ASP.NET MVC3) which uses the jquery ui tab control with the cookie plugin (as demonstrated <a href="http://jqueryui.com/demos/tabs/#cookie" rel="nofollow">here</a>).</p> <p>I set the path of the cookie using the path option when the tab is created:</p> <pre><code>$("#tabs").tabs({ cookie: { path: '/A/' } }); </code></pre> <p>In firefox this works correctly. No matter what the url is after "/A/" (ex "A/B/C") the tab control always correctly remembers which tab was last selected and switches to it when I re-load the page.</p> <p>However, on Chrome (v21), occasionally the browser will add another tab cookie with a different path. I then end up with two cookies, one with the path "/A/" as I originally created, and another one with the path "/A/B/" which is the url I am currently on. Unfortunately, it seems that this "double cookie" causes the wrong tab to sometimes load when the page is refreshed, since the two cookies seem to conflict.</p> <p>Is there any way to prevent this behaviour in chrome? I've tried several programatic solutions (such as forcing the path to "/A/" if the path contains "/A/", but as that code is never reached it seems chrome is doing it automatically).</p> <p>Thanks for the help!</p> <p>Seems the problem was that chrome doesn't differentiate between cookies with the same name on different paths; so the other tab control I had in my application was messing things up. Once I gave the cookie a unique name things started working properly!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload