How can I set a persistent variable in JavaScript?

Hi

I would like to set a variable that will hold while a customer goes through a few pages. How can I do this. It sounds like it a java script feature. Does anyone have a simple one I can use. Variable can be set to 1 or 2.

Look forward to some wisdom out there