No, my concept is NOT bogus, your understanding is.
First, here is a quote from the link I graciously researched for you.
name: The name of the cookie. 'cookiename' is called as $_COOKIE['cookiename']
So, in your case it is $_COOKIE['auth']
-- or --
$auth
on systems that allow globals.
#2,
while you are able to say $_POST[ID], php says to say $_POST['ID']
Array do's and don'ts
Why is $foo[bar] wrong?
You should always use quotes around an associative array index. For example, use $foo['bar'] and not $foo[bar]. But why is $foo[bar] wrong? You might have seen the following syntax in old scripts:
<?php
$foo[bar] = 'enemy';
echo $foo[bar];
// etc
?>
This is wrong, but it works. Then, why is it wrong? The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes), and PHP may in future define constants which, unfortunately for your code, have the same name. It works, because the undefined constant gets converted to a string of the same name automatically for backward compatibility reasons.
http://www.php.net/manual/en/language.types.array.php
So you see, it is $_POST['ID'] like I said the first time.
Now, lets move on:
if I make my value $_POST[ID] how am I gonna protect pages?
What ever do you mean? Why don't you give us a clue what you are using ID for? I am assuming ID is the persons ID #, so you can use it to look up their record. YOU are scary. It sounds like you are using it to protect pages? How? The way you had it before, you had it in the parameter that specifies you are using a secure channel. Since I don't have a CLUE what you intend to do with ID, then I assume you don't understand what the 'secure' parameter does, or how to use it, so don't.
When I say forget all those other parameters, its because they will only confuse you. Stick with understanding how cookies send data, and THEN worry about the bells and whistles.
like grrr.. i wish i could make 2 cookie files or 2 values.
There you go again. Instead of reading, or thinking about it, you just get frustrated.
Again, from the site:
Cookies names can be set as array names and will be available to your PHP scripts as arrays but seperate cookies are stored on the users system. Consider explode() or serialize() to set one cookie with multiple names and values.
..and what makes you think you can't set 2 cookies? Did you try?
Additionally, if you set a cookie to a comma delim string, you could always 'split' it out to use one cookie for many values.
So, why don't you just calm down, read the link page I sent, simplify, and test with test scripts instead of dropping your test code into your production, where it may be difficult to figure out what is going on?