View Full Version : ASP Cookies with PHP

11-08-2007, 08:14 PM
I have a PHP script that I am trying to get to work with ASP. I am using PHP to access a LDAP database then it needs to pass some data to a ASP page. I could do it through a URL, but we would like to keep the data off of the address line. I have ask the ASP guy to send me a ASP script to read cookies from the PHP page so that I could get the cookies correct. When I run the PHP script I get a cookie that seems to have the correct data in it but I don't know if it is in the correct form.
My PHP script is:
echo"<a href='http://www.mypage.org/timeatscookies.asp'> go";
and the ASP to read it is:
response.write(request.cookies("UserInfo")("Name")) & "<br>"
response.write(request.cookies("UserInfo")("School")) & "<br>"
response.write(request.cookies("UserInfo")("Email")) & "<br>"

Yum, Yum!!!

All that I get is the Yum, Yum!!!
Does anyone have any suggestions on how to write the cookie so that ASP can read it? If anyone has any other suggestions for good ways to get the data to the ASP script I am open to looking at other options.


11-08-2007, 08:31 PM
Does ASP store the cookies with keys like that (Userinfo['Name'])?
There's a snippet to list all cookies at the bottom of this page (http://www.codefixer.com/tutorials/cookies_with_keys.asp). You probably just have the name wrong. Or are you trying to read cookies from another domain?

11-08-2007, 09:18 PM
Thanks for your quick reply.

I wish that I could answer your question about how the ASP stores the cookies with keys, but ............. what I know about ASP....... well I can spell ASP and that is about it....
Right now the ASP page is on a server and the PHP page is on my laptop. I have set a host file to point tim.mypage.org to go to so I tricked my laptop to use the same domain. The cookie that is stored on my laptop has the correct domain name on it. I had changed the domain name on the code that I posted, but did not change it in all of the code. I have edited it now.
I was hoping that I could have the ASP people let me know how they wanted the data and I could give it to them in a way where they did not have to change the existing ASP scripts more than needed. If things need to be changed on the ASP side then I will pass that information along, But the only thing that I have any control over is the PHP coding.

Again thanks for any information