Jump to content

My cookies never turn out right


dzhax

Recommended Posts

I thought I would get creative with my title tonight. I am trying to set a cookie when a page loads and it will not set.

<?php    if(isset($_GET['directlink'])){	    $expire=time()+60*60*10; //set expire 10 minutes from now	    setcookie("directLink", $_GET['directLink'], $expire);	 }?>

Is there something im missing? I have been staring at this code for 30 mins now. if i echo $_Cookie['directLink']; it doesnt print anything to the screen its as if its not even being set. Some help will be much appriciated.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...