We have an ASP intranet web application that have been developed over years which is running on IIS6. Nowadays, we would like to add some new functionalities using PHP language instead. PHP is running fine on the same server. Sessions variables need to be shared between both ASP and PHP.
I am asking if there is other alternatives to share session between classic ASP and PHP instead of using database as gateway (too much resources consuming for us)? Both side need to read/edit session variables.
By tweaking a bit, I've noticed that a PHPSESSID and ASPSESSIONID is generated on PHP side every time a user is logged in the ASP web application. These are also visible on the ASP side, which are stored inside the server Variable HTTP_COOKIE, so I think there may be a correlation between ASP session and PHP sessions variables at the heart of IIS.
So,
-- ASP --
<% Response.write ('HTTP_COOKIE') %>
gives:
__utma=...; __utmz=...; computer%5Fid=AAA; lan=fre;ASPSESSIONIDXXXXXXXX=BBBBBBBBBBBBBBBBBBBBBBBB; user_login=cccc
-- PHP --
echo '<pre>';
var_dump($_COOKIE) ?>
echo '</pre>';
gives:
Array
(
[__utma] => ...
[__utmz] => ...
[computer_id] => AAA
[lan] => fre
[ASPSESSIONIDXXXXXXXX] => BBBBBBBBBBBBBBBBBBBBBBBB
[user_login] => cccc
)
on ASP side, if I write :
<% Request.Cookies(strCookie)(strKey) %>
in a loop, it gives me bunch list of key/values session cookies stored.
But on PHP side, I can't find a way to get these key/value list. May be it is the way to go and find more? A real existing implementation would help more but any answers are welcome.