tags:

views:

72

answers:

4

I have the following problem - a third party software is setting a cookie with the login credentials and then forward the user to my app. I now need to retrieve the cookie values:

The problem is - I can do this easily in the Frontend/AS3 with

var ticket : String = CookieUtil.getCookie( 'ticket' ).toString();

but in PHP, the cookie is not within the $_COOKIES array.

The cookie values are:

Name: ticket
Domain: .myserver.com
Path : /
Send for: encrypted connections only
Expires: at end of session

The one I see, and set before in PHP, is:

Name: myCookie
Host: myserver.com
Path : /
Send for: any type of connection
Expires: at end of session

Actually, since host/domain are both the same, it should be visible in the PHP script, since it is running on this domain.

Any thoughts? Thankx

Martin

+1  A: 

Could this be domain sub domain issue? I mean www.myserver.com is not 'under' .www.myserver.com ... ?

The cookie should have the domain set to ".myserver.com"

Currently the only way to get this cookie is to have a script living under ".www.myserver.com" like "app.www.myserver.com"

EDIT: The OP had a typo. But are cookies with domain "myserver.com" members of ".myserver.com" ?

zaf
Ah, I am sorry, that was a typo on my side. Edited my questions. It is of course .myserver.com and myserver.com
Martin
A: 

Any thoughts?

Actually, cookie is not a text file. But merely HTTP header.
So, to see a real cookie, one must watch HTTP interchange log, not the files on the client PC.
I am sure watching HTTP log would bring some light on the situation. It can be dome in many ways, LiveHTTPheaders mozilla addon for example.

Both Cookie and Set-Cookie headers are to count.

Col. Shrapnel
+1  A: 

I don't know if this can be useful for you but, the PHP manual (cookie section) states:

Any cookies sent to you from the client will automatically be included into a $_COOKIE auto-global array if variables_order contains "C".

You should check the php config variables_order directive in order to be shure the Cookie flag is set.

Eineki
that's incredible case. I have never seen a php installation with such a setting.
Col. Shrapnel
Me too, but if there is a tiny chance of a misconfigured installation, as the manual reports, maybe it is worth a deeper check
Eineki
by the way, your supposition seem the right one to me
Eineki
+1  A: 

ahahah got it! $_COOKIE not $_COOKIES :)

get a habit to program in PHP with error_reporting(E_ALL) reporting level, to avoid such a silly mistakes

Col. Shrapnel
How did you figure that out? You sitting next to him?
zaf
I read his question :)
Col. Shrapnel