Valhalla Legends Forums Archive | Web Development | Re: Cookie retrieval

AuthorMessageTime
UserLoser
I have website1.com, and I have an ISAPI DLL hosted on website2.com.  Now, using the ISAPI DLL hosted on website2.com, how can I get the cookie for a user on website1.com?

i.e., in website1.com in the page source it includes the ISAPI.dll (<img src="website2.com/isapi.dll">).  Thanks.

All my code works correctly, but I'll show anyways.  But how to go about getting the website1.com cookie?

Cookie returns value, but like I said it returns website2.com's cookie.
[code]
char *Cookie = (char*)GetVariable(pEcb, "HTTP_COOKIE");

const char *GetVariable(EXTENSION_CONTROL_BLOCK *pEcb, const char *Variable)
{
DWORD dwBuf = 1024;
CHAR *szBuf = new CHAR[1024];

pEcb->GetServerVariable(pEcb->ConnID, (LPSTR)Variable, szBuf, &dwBuf);

return szBuf;
}
[/code]
May 4, 2007, 1:25 AM
rabbit
I'm not to sure about this sort of thing, but couldn't you make an ISAPI for website1 that returns a cookie, and then have ISAPI from website2 call up the first?
May 4, 2007, 4:54 AM
Spht
For obvious privacy/security reasons, browsers will not allow websites to access cookies set by other websites

Try looking into alternatives to cookies

You didn't tell us exactly what you're trying to do here and why you need two domains to accomplish it, so it's hard to say if you can use cookies or not--there may be a workaround, depending on what you're doing and how your sites are set up
May 4, 2007, 4:32 PM
UserLoser
[quote author=Spht link=topic=16671.msg168716#msg168716 date=1178296371]
For obvious privacy/security reasons, browsers will not allow websites to access cookies set by other websites

Try looking into alternatives to cookies

You didn't tell us exactly what you're trying to do here and why you need two domains to accomplish it, so it's hard to say if you can use cookies or not--there may be a workaround, depending on what you're doing and how your sites are set up
[/quote]

Making tracker for MySpace.  MySpace doesn't allow any <script> tags or javascript stuff at all, so it's hard to do.
May 5, 2007, 7:29 AM
UserLoser
[quote author=rabbit link=topic=16671.msg168713#msg168713 date=1178254496]
I'm not to sure about this sort of thing, but couldn't you make an ISAPI for website1 that returns a cookie, and then have ISAPI from website2 call up the first?
[/quote]

Can't do that, read my post ^ :)
May 5, 2007, 7:31 AM
Barabajagal
Couldn't you make a dynamic image in PHP that stores a count in a text file or database?

Edit: Here's an example way that stores every IP that views a certain image on a myspace page:
1) Create a php image (you should know how to do this, it's easy).
2) In the file, add the following code [code]  $countdir = "count.txt";
  $IP = $_SERVER["REMOTE_ADDR"];
  $out = fopen($countdir, "a");
  fwrite($out, $IP."\n");
  fclose($out);[/code]
3) In the file's directory, make an empty text file called count.txt.
4) Rename the file to have a .jpg/.gif/.png extension (whatever file type you set it to in the Header() of the PHP file).
5) Add a .htaccess file to the directory, and include the following line:[code]AddType x-mapp-php5 .png[/code] (Replace .png with whatever file type you want).
6) Upload this all to your webspace [make sure the image is uploaded as ASCII if FTP-ing], and then add the image using img src like any other image. View the text file to get a list of all the IPs.

To demonstrate: http://myspace.com/r3alityripple The image is the dynamic quotations. View all my visitors' IPs at http://images.realityripple.com/dynamic/myspace/count.txt .

I suspect you could run anything you want within that PHP file... but I'm gonna leave that up to you to test ;)

Hope that helps.
May 5, 2007, 7:52 AM
UserLoser
don't want to log just ip, need cookie info.  logging ip is easy and it already does that
May 5, 2007, 5:38 PM
Barabajagal
I'm saying you can run anything you could run in a PHP script that way. The IP was an example.
May 5, 2007, 6:00 PM
UserLoser
[quote author=RεalityRipplε link=topic=16671.msg168737#msg168737 date=1178388055]
I'm saying you can run anything you could run in a PHP script that way. The IP was an example.
[/quote]

hmm what you did was interesting with the png/php spoof, wonder if i can do that somehow...all i know is there's this one myspace tracker (ispacetracker.com) that shows who it is who views your page, their name (real name),  their picture, etc etc...wonderng how it gets all that info.  that tracker is in a .swf file though
May 5, 2007, 9:05 PM
Barabajagal
It probably just reads the "SplashDisplayName" and "ME" cookies somehow. As I recall, you can set what domain to make the flash object think its in, thanks to the proprietary Embed tag (the w3c standard is object; embed isn't supported in the standards).
May 5, 2007, 10:02 PM

Search