Jump to content

[SOLVED] Cookies; Reading contents from other domains? Or at least check for existance?


Dale_G

Recommended Posts

Hey there, anyone familiar with MySpace?

 

I am, for those of you who don't know it's a fun little site you can sign up to log in, meet friends, talk, chat, whatever.

 

Anyway, they seem to store an awful lot of cookies on your computer.

 

One is called "UNIQUELOGINTAKEOVER_XXXXXXXX", the X's being your 8 digit Friend ID. Everythings encrypted, don't worry I'm not out here for passwords. :P

 

But, would it be possible to list all cookies on your computer from another domain? Or, at the very least is it possible to...see if a cookie exists, just by name, and return a true or false, without revealing it's contents?

 

Like, say I know someones Friend ID and it's 11111111, would it be possible to check for the existence of "UNIQUELOGINTAKEOVER_11111111"?

 

if ( isset( $_COOKIE['UNIQUELOGINTAKEOVER_11111111'] ) )
{
echo 'HEY 11111111!!';
}
   
else
{
echo 'WHO ARE YOU?';

}

 

Would anything like that be possible? Keep in mind that these cookies are from http://www.myspace.com and this script resides on a different server. I know there are some restrictions involving cookies on other servers, but, just wondering if it's possible. :)

 

Thanks!

Link to comment
Share on other sites

Well if the cookie had a value.

 

<?php
startsession();


$uname = "xxxxx";

setcookie("cookiename_xxxxx");

if(isset(echo $_COOKIE["cookiename_xxxxx"])){
echo "Hey, I know you:" $_COOKIE["cookiename_xxxxx"];
} else {
echo "I don't know you...do I?";
}
?>

 

(PS...I Was in school when I tiped this up and class is just now over so i dont have time to look over it.)

 

-derrick1123

Link to comment
Share on other sites

Well if the cookie had a value.

 

<?php
startsession();


$uname = "xxxxx";

setcookie("cookiename_xxxxx");

if(isset(echo $_COOKIE["cookiename_xxxxx"])){
echo "Hey, I know you:" $_COOKIE["cookiename_xxxxx"];
} else {
echo "I don't know you...do I?";
}
?>

 

(PS...I Was in school when I tiped this up and class is just now over so i dont have time to look over it.)

 

-derrick1123

 

This is for using cookies on YOUR domain. He is looking to access cookies for another domain.

Link to comment
Share on other sites

If you are looking for writing script for yourself, to use locally on your machine, you can look into GreaseMonkey (JavaScript based) as it should have access beyond what normal webpage JavaScript can get to. But as far as a creating a webpage and using PHP or JavaScript to access cross-domain cookies, I think you are out of luck.

Link to comment
Share on other sites

Right, right I see thanks.

 

So, it wouldn't be possible to even check if a cookie exists? Not even reading it's contents, just, maybe even attempting to create it? What happens if you attempt to create a cookie that already exists?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.