Php Gurus pls help.

I am trying to set a cookie that shd live for 30 days. But the cookie always expires after the session is closed.
setcookie("username", "user1", time() + (86400 * 30));
I set firefox to 'ask before setting cookies' and when the cookie is being set Firefox shows "Expires: at end of session"

What am I doing wrong. Thanks in advance.