Look in the html table called "Environment" for "HTTP_COOKIE". It will show a list of the cookies set for the domain that the script is running in.
If you don't see any cookies set with your ASP scripts then
- It's possible that you are calling the script from outside the domain.
- The cookies may have expired
- the PHP session.cookie_path or session.cookie_domain settings aren't set properly
- You may not have called the page again (cookies are only set when the page that sets it unloads. leave the page then go back to see if the cookie is set)
Of course, all variables can be stored in memory, but exchanging data held in volatile memory on a server between ASP and PHP scripts is something you likely won't want to try.
Try making these 2 scripts (one is asp and one is php) and putting them in the same directory then running the cookietest.asp file first through your browser.
Code for cookietest.asp :
<html>
<form action=cookietest.asp method=get>
Your name: <input type=text name=n value=<%=Request("myname")%>> <input type=submit>
</form>
<%
if Request("myname") <> "" then
Session("myname") = Request("myname")
%>
This ASP script now set a cookie. Click <a href=cookietest.php>here</a> to test the cookie in php
<%
end if
%>
</html>
Code for cookietest.php :
<html>
<?php
if (isset($HTTP_COOKIE_VARS["myname"])) {
echo "Congrats ".$HTTP_COOKIE_VARS["myname"]."! The test worked! This script got your name from a cookie set in the ASP script.";
} else {
echo "The test failed. The cookie cannot be read. Try testing it with ASP scripts, viewing your browser's cookie folder, or other means to check the status of the cookie for this domain.";
}
?>
</html>
As a last resort, remember that you can pass all info that isn't too private or too long in URL query strings. cheers 🙂