Dale_G Posted March 24, 2008 Share Posted March 24, 2008 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. 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! Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/ Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 Not that I know of. It would be a major security violation to grant you access to those. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499604 Share on other sites More sharing options...
derrick1123 Posted March 24, 2008 Share Posted March 24, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499610 Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499619 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 asp.net can probably do it through IE but it would be a big security vulnerability for someone to let you into that data as it is sensative. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499622 Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499628 Share on other sites More sharing options...
Dale_G Posted March 24, 2008 Author Share Posted March 24, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499642 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 you wouldn't replace a different domains, only your owns in which case it should overwrite it Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499644 Share on other sites More sharing options...
Dale_G Posted March 24, 2008 Author Share Posted March 24, 2008 Ah, that's right.. Well, thanks for your help everyone. I've got my answer now. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499655 Share on other sites More sharing options...
lordfrikk Posted March 24, 2008 Share Posted March 24, 2008 You can't do it, because it would be security vulnerability. Quote Link to comment https://forums.phpfreaks.com/topic/97645-solved-cookies-reading-contents-from-other-domains-or-at-least-check-for-existance/#findComment-499664 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.