Forum Moderators: coopster

Message Too Old, No Replies

set get COOKIE

         

nick patrick

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

10+ Year Member



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

coopster

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

WebmasterWorld Administrator 10+ Year Member



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]