Implement cookie handling after a move to the Ruby Sinatra framework (as it handles cookies nicely).