trying to setcookie inside JS but no use
Posted: Tue Jan 28, 2003 5:06 pm
hello... i have been working on this for 2 days with no use. It is giving me a hard time. I reduced the code to 3 lines so i can work with it.
I am trying to set php cookie inside JS. Any commments are greately appreciated.
the code follows:
echo "<script language=php type=text/php>";
echo "setcookie(\"hacp_rfp\", 'aa:dd:vv', '1043789457' , \"/\");";
echo "</script>";
and i also tried the followiong but also with no use.....
echo "<script language=php type=text/php>";
setcookie("hacp_rfp", 'aa:dd:vv', '1043789457' , "/");
echo "</script>";
to make sure that the content of the values are current, i tried it as a PHP code and this one WORKS fine:
$lifetime = time()+3600;
setcookie("hacp_test", "aa:bb:cc" , $lifetime, "/");
echo $lifetime;
I am trying to set php cookie inside JS. Any commments are greately appreciated.
the code follows:
echo "<script language=php type=text/php>";
echo "setcookie(\"hacp_rfp\", 'aa:dd:vv', '1043789457' , \"/\");";
echo "</script>";
and i also tried the followiong but also with no use.....
echo "<script language=php type=text/php>";
setcookie("hacp_rfp", 'aa:dd:vv', '1043789457' , "/");
echo "</script>";
to make sure that the content of the values are current, i tried it as a PHP code and this one WORKS fine:
$lifetime = time()+3600;
setcookie("hacp_test", "aa:bb:cc" , $lifetime, "/");
echo $lifetime;