Пример работы с куками...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='https://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
.act {
color: red;
}
</style>
<script type='text/javascript'>
$(function(){
$('.list .sw-links').on('click',function(){
var o=$(this);
var pr=o.closest('ul');
var it=pr.find('.sw-links').index(this);
set_cookie('item',it);
pr.find('.act').removeClass('act');
o.addClass('act')
return false;
});
var it=get_cookie('item');
if (it) {
$('.list .act').removeClass('act');
$('.list .sw-links').eq(it).addClass('act')
};
});
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ){
var cookie_string = name + "=" + escape ( value );
if ( exp_y ) {
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
if ( path )
cookie_string += "; path=" + escape ( path );
if ( domain )
cookie_string += "; domain=" + escape ( domain );
if ( secure )
cookie_string += "; secure";
document.cookie = cookie_string;
}
function get_cookie ( cookie_name ){
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results )
return ( unescape ( results[2] ) );
else
return null;
}
</script>
</head>
<body>
<div class="filt-bx">
<div class="t">Проекты:</div>
<ul class="list">
<li><a class="sw-links sw-all" href="">Все</a></li>
<li><a class="sw-links sw-l1 act" href="">Город</a></li>
<li><a class="sw-links sw-l2" href="">Год</a></li>
<li><a class="sw-links sw-l3" href="">Функция</a></li>
</ul>
</div>
</body>
</html>