Maintain Session Across the servers?
<p>I have two applications on different servers. One application is on LAMP environment and other one is on ASP.Net 4.0 with IIS7. Main application is in PHP whereas ASP.Net application is just a module of PHP application.</p>

<p>Both of the applications would be sharing same Database which is in MySQL.</p>

<p>I need to share sessions across the servers. Has anyone done this before? I have few thoughts on this -</p>

<ol>
<li><p>Create Seesion table in MySQL database and let PHP and ASP.Net read/write session into this table. => For this PHP code would need to be changed. Client may not be agreed for this. </p></li>
<li><p>Since PHP stores sessions in file, write web service on PHP server which would read/write session details to the session files. ASP.Net Application can consume this service to read/write sessions.Service would accept  "PHPSessionId" as an input parameter.</p></li>
<li><p>Give direct access to ASP.Net application to read/write PHP Session files which are on PHP server. => Not sure giving permission to session files would be a great idea.</p></li>
</ol>

<p>Looking forward your advice whether any point mentioned above makes sense or any other best suits as per your experience.</p>
