[A27]Matt Posted July 16, 2006 Share Posted July 16, 2006 i know that in php you can get an ip by using the code getenv("REMOTE_ADDR"; but how would i get a cookie? Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/ Share on other sites More sharing options...
willfitch Posted July 16, 2006 Share Posted July 16, 2006 $_COOKIE['cookie_name'] Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58807 Share on other sites More sharing options...
Branden Wagner Posted July 16, 2006 Share Posted July 16, 2006 first you have to have set the cookie.. if you set the cookie then[code]$_COOKIE['$cookiename'];[/code]this is a simple cookie only storing a single value. Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58808 Share on other sites More sharing options...
[A27]Matt Posted July 16, 2006 Author Share Posted July 16, 2006 I mean, i have the remote file on the server, with all the php code needed to get teh cookie, but i'm not allowed to post "example.php?c='+document.cookie". If i was allowed to post that, it would take that cookie, and store it in a text file on my server. Problem is, im not. Any suggestions on how to get around this? Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58811 Share on other sites More sharing options...
Branden Wagner Posted July 16, 2006 Share Posted July 16, 2006 im sorry i dont understand what your asking. Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58813 Share on other sites More sharing options...
[A27]Matt Posted July 16, 2006 Author Share Posted July 16, 2006 i have an image on my website that executed any php script when viewed. so i posted it on my own forums to test it, and it does log my referer and webbrowser. im trying to figure out what i should put in my code to have it log my cookie. When i type 'javascript:alert(document.cookie)' in my webbrowser i get this [IMG]http://img133.imageshack.us/img133/4430/untitledyh5.jpg[/img] That is my cookie. What would i put in my script to log that as well? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58814 Share on other sites More sharing options...
needhelp56 Posted July 16, 2006 Share Posted July 16, 2006 hmm ive been wondering this as well Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58837 Share on other sites More sharing options...
Branden Wagner Posted July 16, 2006 Share Posted July 16, 2006 Why would you want to log the cookie? and which cookie the cookie from the refering url? or a cookie on your site? Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58848 Share on other sites More sharing options...
needhelp56 Posted July 16, 2006 Share Posted July 16, 2006 from the refering URL for me. Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58854 Share on other sites More sharing options...
rab Posted July 16, 2006 Share Posted July 16, 2006 No, from it looks like hes setting up a cookie logger. Java script is client side only, so if your going to set up a cookie logger find a way to have others see it. I'm not going to explain more because this most likely violates the rules. If a mod sees this, you may want to lock this topic. For those of you who don't know, a cookie logger is self explanatory. You inject malicious java script to send an HTTP request to your site to get the users cookie. Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-58862 Share on other sites More sharing options...
needhelp56 Posted July 16, 2006 Share Posted July 16, 2006 im talking about PHP, not javascript Quote Link to comment https://forums.phpfreaks.com/topic/14736-cookie-help/#findComment-59105 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.