Click here to Skip to main content
15,888,047 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
I write code below but not set coockie!

<pre>setcookie("uname", $_POST['usname'], time()+36000);</pre>

can any one help me?
Posted
Comments
DamithSL 25-Dec-14 6:48am    
how you check cookie?
Karim Pazoki 25-Dec-14 6:51am    
I check $_POST['usname'] and set Session but coocki doesn't set.

$_SESSION['uname']=$_POST['usname'];

I check it with print_r($_SESSION); print_r($_COOCKIE);
DamithSL 25-Dec-14 6:57am    
try
if (!isset($_COOKIE['uname'])) print_r($_POST['uname']);
else print_r($_COOKIE['uname']);
Kornfeld Eliyahu Peter 25-Dec-14 7:20am    
"setcookie() ... This requires that you place calls to this function prior to any output, including <html> and <head> tags as well as any whitespace." - from PHP manual...

 
Share this answer
 
I solved it myself.tnx for help.
 
Share this answer
 
Comments
King Fisher 26-Dec-14 23:43pm    
how did you Solved .post your Solution that may help others :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900