views:

36

answers:

1

I'm having trouble figuring out this issue I'm having with cookies and asp.net applications.

A webservice is used to get user info with the following method call:

GetUser(token)

The token parameter comes from a cookie named "token". A user visits the website, and a token cookie is created. The website needs to interract with a third-party application in the same domain, so they share the token cookie, and the third-party app will make the GetUser call with the token.

For some reason the third-party app is expecting the prefix "token=" in the cookie's value.

If the token cookie's value is "ABC123", the call doesn't work, but if I manually edit the content of the cookie so the value is "token=ABC123" -- then it works. However, I know the webservice method is still being called as: GetUser("ABC123") even though "token=" seems to be in the value.

Why does the third-party app seem to need the cookie's name in the value to actually work?

A: 

Because the web service is parsing the value you pass to extract the value, probably in order to support more data values in addition to the username, for features that you are not using (like "token=ABC123,active=True", for only retrieving an active user). Or was originally built that way.

JeffSahol