[help]cookie obtaining without header

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Th3Proph3t
Forum Newbie
Posts: 2
Joined: Sat Jul 16, 2011 5:25 am

[help]cookie obtaining without header

Post by Th3Proph3t »

hi everyone ive had this question so i decided to signup here :drunk:

im a newbie programmer in PHP ofc...

can anyone tell me any way to get cookie without header?
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: [help]cookie obtaining without header

Post by oscardog »

Not sure I understand the question, to get a cookie's value you simply use...

Code: Select all

$myCookie = $_COOKIE['cookie_name'];
Th3Proph3t
Forum Newbie
Posts: 2
Joined: Sat Jul 16, 2011 5:25 am

Re: [help]cookie obtaining without header

Post by Th3Proph3t »

thanks for the reply but i already know that :D i mean ALL the cookies...

ones i know are:
$cookie = '<script>document.write(document.cookie);</script>';
$cookie = ''; foreach($_COOKIE as $x =>$actor) {$cookie .= $x."=".$actor.";";}
$cookie =''; foreach($_REQUEST as $x =>$actor) {$cookie .= $x."=".$actor.";";}
$cookie = $_SERVER['HTTP_COOKIE'];

but none of these are what i need. anyone have any other ways for grabbing cookies?
Post Reply