Using jQuery Cookie to store state of an element

The plugin is so awesome because it helped me to get rid of the complicated and repeated line of code I use to return to the template to render state of an element, (e.g the current selected menu item). I was use something stupid like:

views.py:

...def my_view(request): selected_nav = 'First menu'....

my_template.html: I then get the return value and choose which menu is in the selected state: