If I remember it right, according to Autrijus's presentation at YAPC::Toronto, we'll be able to do exactly this in Perl 6. He was even talking about being able to maintain entire state of the application in few KiloBytes..thereby eliminating the need for cookies !!
Really cool. Whenever we're blessed with it.