Jump to content

These are both server side so why does it not work


stuckwithcode

Recommended Posts

I still don't get it, if you look at the code below why does the cookie take a refresh but the variable doesn't then.

Could you explain in detail please.

 

<?php
session_start(); 

setcookie("random",1,time()+600000,"/");
echo $_COOKIE['random'];

$variable = 1;
echo $variable;
?>

 

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.