Cookie isn't setting, but i allow cookies
<p>I am trying the Post-Redirect-Get pattern.</p>

<p>Here are my custom functions</p>

<pre><code>&lt;?php
function ReadCookieMessage()
{
    if (($_COOKIE["c"]) &amp;&amp; ($_COOKIE["t"]))
    {
        $message = $_COOKIE["t"];
        $message = htmlspecialchars($message);
        if ($_COOKIE["c"] == "r")
        {
            $cssclass = 'error_msg';
        }
        else if ($_COOKIE["c"] == "g")
        {
            $cssclass = 'success_msg';
        }
        setcookie("c", "", time()-3600);
        setcookie("t", "", time()-3600);
        return '&lt;div class="' . $cssclass . '"&gt;' . $message .'&lt;/div&gt;';
    }
}
?&gt;
&lt;?php
function SetCookieMessage($c,$t)
{
    setcookie("c",$c, time()+3600);
    setcookie("t",$t, time()+3600);
}
?&gt;
</code></pre>

<p>I do <code>SetCookieMessage("g","Your password has been changed, you may now login again");</code> on my change password page.</p>

<p>Then i do </p>

<blockquote>
  <p>echo ReadCookieMessage();</p>
</blockquote>

<p>on my login page. I am not sure whats up. setcookie works when i set the r cookie if they check remember when they login. I also tired </p>

<pre><code>setcookie("c","g", time()+3600);
setcookie("t","Your password has been changed, you may now login again", time()+3600);
</code></pre>

<p>in replacement for the <code>SetCookieMessage</code> function. </p>

<p>Not sure if </p>

<pre><code>if ($SqlChangePass)
                {
                    session_unset();
                    session_destroy();
                    setcookie("r", "", time()-3600);
                    SetCookieMessage("g","Your password has been changed, you may now login again");
                    header("Location: /login");
                }
</code></pre>

<p>will be any helpful to you. Its in the changepassword script. </p>

<p>Php isn't giving me any errors. The goal of the functions is to set a message color(r means red and g means green) and text. Then take them to another page and read the message. The page it goes to isn't showing any sort of a message. </p>
