In fact any method of retrieving the data can be used. The interesting part of maintaining state come along when you want to retrieve the data associated with a particular "session". You have to work out a method of branding the browser, then retrieving that branding and associating it with the data you've stored server side.
- Tied hash
- A database
- regular old file
- hidden fields in the page...
There are three main methods of branding a browser, cookies, in the URL and using hidden variables in your pages...
I wont go into detail, however, there is a wealth of information available all over the web, and here on perl monks.