Skip to main content

Search and Top Navigation

#4938 closed bug (worksforme)

Opened November 01, 2009 11:13PM UTC

Closed March 23, 2011 02:40PM UTC

Issue with Tabs/Cookie

Reported by: Eagle Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.tabs Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

The Tabs component supports remembering which tab was last made active through the use of cookies and the jQuery Cookie plugin. However, it appears that the Tabs code does not actually invokve the Cookie plugin in the correct fashion.

The cookie plugin for reading and writing cookies works off the basis that:

  • If a name and value are passed, it creates a cookie with those

values (and any other parameters).

  • If only a name is passed, the corresponding cookie is read if

possible.

  • If a name and null are passed, it expires the named cookie.

The trick is that the cookie plugin uses typeof to determine whether a value was supplied, even if it is a null:

jQuery.cookie = function(name, value, options) {

if (typeof value != 'undefined') { // name and value given, set

cookie

The call from jQuery UI to the plugin, however, provides null for the value parameter even when attempting to read back the value, meaning value is not undefined but rather null, and thus invoking the expiry mechanism.

Attachments (0)
Change History (2)

Changed November 17, 2009 06:11PM UTC by jzaefferer comment:1

milestone: TBD1.8

Changed March 23, 2011 02:40PM UTC by scottgonzalez comment:2

resolution: → worksforme
status: newclosed

Works fine for me, testing in master and 1.7.2.