setcookie('ses_userId',$uId,strtotime('+50 days'));
+50 days表示50天後過期,同時可設置的有+1 year, +3 month,+2 week等,具體可查看strtotime的語法
其它類同。