you can use the cookie option built directly into the plugin. Initialize tabs with the specified cookie option.
$( ".selector" ).tabs({ cookie: { expires: 30 } });
Get or set the cookie parameter after init.
//getter var cookie = $( ".selector" ).tabs( "option", "cookie" ); //setter $( ".selector" ).tabs( "option", "cookie", { expires: 30 } );
source share