tag:support.appharbor.com,2010-11-23:/discussions/problems/2606-memcached-backed-sessionprovider-for-session-stateAppHarbor: Discussion 2012-02-27T22:51:55Ztag:support.appharbor.com,2010-11-23:Comment/138635502012-02-21T20:38:35Z2012-02-21T20:38:35ZMemcached-backed SessionProvider for session state<div><p>Hi Noel</p>
<p>When sessions are stored in process (the default), the session
cannot be shared between instances. This is a problem since a user
may login and have a session set on one instance that another
instance serving a subsequent request to that user will not know
about.</p>
<p>By storing sessions in Memcacher (whose servers are run
separately from the AppHarbor application servers), sessions for a
given application are stored in one central location shared by all
instances. A user can thus be logged in on one AppHarbor instance
and that session is accessible (via the central memcached session
store) to other instances serving requests for that
application.</p>
<p>Note that Session State Servers (that is non-in-process session
state) is not available on AppHarbor and we recommend using
Memcached.</p>
<p>Let us know if you have other questions.<br>
Michael</p></div>friismtag:support.appharbor.com,2010-11-23:Comment/138635502012-02-21T21:42:23Z2012-02-27T08:18:01ZMemcached-backed SessionProvider for session state<div><p>Michael,<br>
Thanks for the reply.<br>
I understand that sessions are stored seperatly, using memcacher,
on different servers to where an application is deployed.<br>
My question is if the server where the session is stored using
memcacher goes down and my application tries to retrieve that
session what happens?<br>
Am I correct in saying that the key-value collection stored in
memcacher Server1 is not duplicated (distributed) across to
memcacher Server2 so therefore if Server1 goes down the key-value
cannot be retrieved</p></div>Noel Mc grathtag:support.appharbor.com,2010-11-23:Comment/138635502012-02-27T17:37:31Z2012-02-27T17:37:31ZMemcached-backed SessionProvider for session state<div><p>Hi Noel</p>
<p>You are correct that the memcacher servers are currently not
replicated. What happens if a memcacher server is unavailable would
depend on the provider implementaion, and I haven't checked the
details. Your users would loose their sessions though, and would
have to log back in to your site.</p>
<p>Note that the memcacher servers have excellent uptime. Barring
some initial teething trouble, we have not had any issues keeping
them up.</p>
<p>Let us know if you have other questions.<br>
Michael</p></div>friism