<div dir="ltr"><div><div><span style="font-size:12.8000001907349px">Bill,</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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.</span></div></div><div><span style="font-size:12.8000001907349px"><br></span></div>Tushar<div><br></div><div>You're right that you need to install the memcached server for <span style="font-size:12.8000001907349px">Dancer::Session::Memcached to work. The config line you're referring to</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><code class="" style="font-size:12px;white-space:pre;font-family:inherit!important;padding:0px!important;color:black!important;border-radius:0px!important;border:0px!important;float:none!important;height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;background-image:none!important;background-color:rgb(245,245,245);background-repeat:initial!important">memcached_servers: </code><code class="" style="font-size:12px;white-space:pre;font-family:inherit!important;padding:0px!important;color:blue!important;border-radius:0px!important;border:0px!important;float:none!important;height:auto!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important;background-image:none!important;background-color:rgb(245,245,245);background-repeat:initial!important">"<a href="http://10.0.1.31:11211">10.0.1.31:11211</a>,<a href="http://10.0.1.32:11211">10.0.1.32:11211</a>,<a href="http://10.0.1.33:11211">10.0.1.33:11211</a>,/var/sock/memcached"</code><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">For an explanation of memcached with multiple servers, read the answer starting with 'when you set several servers...'</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><a href="http://stackoverflow.com/questions/352536/how-to-link-memcached-server-together">http://stackoverflow.com/questions/352536/how-to-link-memcached-server-together</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">To see what I mean by 'socket' in reference to </span><span style="font-size:12.8000001907349px">"/var/sock/memcached"  see the 'Socket' section here:</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><a href="http://en.wikipedia.org/wiki/Unix_file_types">http://en.wikipedia.org/wiki/Unix_file_types</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I think the default of memcached_servers is <a href="http://127.0.0.1:11211">127.0.0.1:11211</a> (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]</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>I hope that clears things up, and if not please say so!</div><div><br></div><div><span style="font-size:12.8000001907349px">Andrew</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 15, 2015 at 4:01 PM, William Carr <span dir="ltr"><<a href="mailto:bill@bottlenose-wine.com" target="_blank">bill@bottlenose-wine.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I’ve been using Dancer::Session::Cookie but not in production yet. You don’t have to setup a “session server” with this approach.</div><div><br></div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On Apr 15, 2015, at 10:33 AM, Tushar Dave <<a href="mailto:tushardave26@gmail.com" target="_blank">tushardave26@gmail.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr">Hello All,<div><br></div><div>I am trying to learn session management in Dancer. I have consulted Dancer::Session documentation for the same. The document recommends to use memcached server for production and YAML or Simple for development. My question is specifically related to memcached server. Do I need to setup the memcached server on the system before using Dancer::Session::Memcached? Also, what does this "/var/sock/memcached" mean in the Dancer::Session::Memcached documentation (I believe it is the default location of memcached server after installation on local system)? </div><div><br></div><div>I am sorry if my question is to silly. But I am trying to understand the right procedure.<br clear="all"><div><br></div><div>Thanks for the help.</div><div><br></div><div>Best, <br></div><div><div dir="ltr">Tushar Dave<div><br></div></div></div>
</div></div></div></div>
_______________________________________________<br>dancer-users mailing list<br><a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br><a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br></div></blockquote></div><br><div>
<div><div style="font-size:12px"><a href="http://www.bottlenose-wine.com/" target="_blank"><img src="http://www.bottlenose-wine.com/images/smlogo.gif" width="95" height="30" border="0"></a><span> </span><br>Bill Carr, President at<span> </span>Bottlenose<br><a href="tel:%28413%29%20584-0400" value="+14135840400" target="_blank">(413) 584-0400</a><span> </span><br><a href="http://www.bottlenose-wine.com" target="_blank">http://www.bottlenose-wine.com</a><span> </span><br><a href="http://www.bottlenose-wine.com/vcard/BillCarr.vcf" style="text-decoration:none" target="_blank"><img src="http://www.bottlenose-wine.com/images/vcard.gif" width="13" height="10" border="0" align="absmiddle"><span> </span>Download vCard</a></div></div>
</div>
<br></div></div><br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Andrew Solomon<div><br></div><div>Mentor@Geekuni <a href="http://geekuni.com/" target="_blank">http://geekuni.com/</a></div><div><a href="http://www.linkedin.com/in/asolomon" target="_blank">http://www.linkedin.com/in/asolomon</a><br></div></div></div>
</div>