Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

set get COOKIE

2:51 am on Feb 11, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 13, 2009
votes: 0

how to set and get COOKIE on a single php file
i am doing some thing like
setcookie('test',test,time() + (100),"/",'.example.com');
$test =$_COOKIE['test'];
echo $test;

but not worked and after refreshing one time its works any idea plz

1:12 pm on Feb 11, 2009 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 2

A quick search will turn up some answers for you ...

How can I test whether the browser accepts cookies in php? [webmasterworld.com]
PHP cookie on first page access [webmasterworld.com]