Get value stored in Cookie in php | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Get value stored in Cookie in php

Saturday

Get value from  Cookie in PHP:

                                                  By using  the following code you can retrieve the value stored in cookie. Here I'm using the global variable $_COOKIE to get the value stored in cookies.

Code:
<?php 
setcookie( "cookiename", "cookievalue", time()+60000);
$yourCookie = $_COOKIE["cookiename"];
if ( isset( $yourCookie ) )
   echo "<p>Your cookie value is - $yourCookie</p>";
else
   echo "<p>Nothing in your cookie.</p>";
?>

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets