Jump to content


Photo

Cookie Help


  • Please log in to reply
10 replies to this topic

#1 [A27]Matt

[A27]Matt
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 04:20 AM

i know that in php you can get an ip by using the code getenv("REMOTE_ADDR";  but how would i get a cookie?

#2 willfitch

willfitch
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts
  • LocationNew Hope, PA

Posted 16 July 2006 - 04:21 AM

$_COOKIE['cookie_name']
Zend Certified Engineer (ZEND001989)
www.willfitch.com

#3 Branden Wagner

Branden Wagner
  • Members
  • PipPipPip
  • Advanced Member
  • 111 posts

Posted 16 July 2006 - 04:22 AM

first you have to have set the cookie.. if you set the cookie then
$_COOKIE['$cookiename'];

this is a simple cookie only storing a single value.

#4 [A27]Matt

[A27]Matt
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 04:28 AM

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?

#5 Branden Wagner

Branden Wagner
  • Members
  • PipPipPip
  • Advanced Member
  • 111 posts

Posted 16 July 2006 - 04:32 AM

im sorry i dont understand what your asking.

#6 [A27]Matt

[A27]Matt
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 04:36 AM

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 Posted Image  That is my cookie.  What would i put in my script to log that as well?  Thanks

#7 needhelp56

needhelp56
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 05:33 AM

hmm ive been wondering this as well

#8 Branden Wagner

Branden Wagner
  • Members
  • PipPipPip
  • Advanced Member
  • 111 posts

Posted 16 July 2006 - 06:18 AM

Why would you want to log the cookie? and which cookie the cookie from the refering url? or a cookie on your site?

#9 needhelp56

needhelp56
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 06:47 AM

from the refering URL for me.

#10 rab

rab
  • Members
  • PipPipPip
  • Advanced Member
  • 155 posts

Posted 16 July 2006 - 07:55 AM

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.

#11 needhelp56

needhelp56
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2006 - 11:01 PM

im talking about PHP, not javascript




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users