A question about Drupal Books and assigning classes to the body based on last viewed book I have client site with a few different books in it. There are also some basic pages and other nodes that are not within the books. When you are in the first book the sidebar is blue, when you are in the second book the sidebar is green and the the third has an orange sidebar. This is controlled by a class that is applied to the body from a field in the book module.

Currently, when you access a global page (meaning a page or view outside a book) the sidebar color is a default color. But the client wants these global pages' sidebar color to stay the same as the last viewed book and not switch to a different color until a new book is viewed.

I am not even sure how to begin to go about doing this and am looking for ideas.

Thanks
Thanks to No Sssweat's comment my solution for this was to use Jquery to look for the body class that controls the sidebar color then use jQuery.cookie (already packaged in Drupal just need to make sure it loads on every page) to set a cookie with that value. Then if a page visited that doesn't have the body class that indicates it was a book and therefore also doesn't have the color class then I had jQuery .addClass to add the cookie value to the body element.