How to set the time in JQuery's cookie persistence Tab

ajayvegesna02
ajayvegesna02 used Ask the Experts™
on
I am using the cookie persistence Tab in my JSP appliation...

http://jqueryui.com/demos/tabs/#cookie....

But how to set the Cookie Time in Mints... By Default it will store 1 day in browser...

Thanks,
Ajay
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Erdinç Güngör ÇorbacıPHP Development Team Leader

Commented:
there is the documentation


Initialize a tabs with the cookie option specified.
$( ".selector" ).tabs({ cookie: { expires: 30 } });
Get or set the cookie option, after init.
//getter
var cookie = $( ".selector" ).tabs( "option", "cookie" );
//setter
$( ".selector" ).tabs( "option", "cookie", { expires: 30 } );

Author

Commented:
U have mentioned expires : 30
will 30 stands for Minutes? if so how can we set in seconds

Thanks,
Aj

Author

Commented:
I want to maintain the selected tab only for 1 or 2 mints, after that the user loads the page again i need to show the first tab;

Thanks,
Aj
PHP Development Team Leader
Commented:
$( ".selector" ).tabs( "option", "cookie", { expires: "30s" } );

may do the trick as explained here ;
http://forum.jquery.com/topic/jquery-jquery-cookie-js-units-for-expiry-time-and-null-value-for-cookie-deletion

Author

Commented:
Hi,

IF i put this code.. i lose the tabs functionality...

Any idea??

Thanks,
Aj

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial