Bill,
Once a website with cookies is in production it needs caching systems like Memcached or Redis for key-value data storage where you can access the data from different processes. In development one usually only runs a single process, but in production you'll normally want several processes to be running so that you can have lots of users visiting your site simultaneously. If you don't have a separate caching system then when user gets a cookie (e.g. logs in) with Process A then clicks on a link and that request winds up with Process B, it won't have access to the session data stored in Process A, and will think that the user's cookie is invalid.
Tushar
You're right that you need to install the memcached server for Dancer::Session::Memcached to work. The config line you're referring to
is just an example of how you communicate to Dancer how you've setup memcached. In this case you're saying - I've got a memcached daemon setup on boxes with IP addresses 10.0.1.31-33 all accessible on port 11211, and it's also running on the localhost and you should access it by writing to the socket /var/sock/memcached.
For an explanation of memcached with multiple servers, read the answer starting with 'when you set several servers...'
To see what I mean by 'socket' in reference to "/var/sock/memcached" see the 'Socket' section here:
I think the default of memcached_servers is 127.0.0.1:11211 (i.e localhost). That is, if you've got a single box in production with multiple processes and one memcached on the same box, you don't need a memcached_servers entry in the Dancer config file. [Experts, please correct me if I'm wrong since I've only done this with Dancer2]
I hope that clears things up, and if not please say so!
Andrew