Cookie does not set

前端 未结 4 749
Happy的楠姐
Happy的楠姐 2021-01-21 23:16

I have a cookie that will not set on the remote server, works find locally. No error messages, var_dump gets me Null, echo is blank.



        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-22 00:09

    This is rather peculiar - I assume this could have something to do with PHP configuration.

    See what the return value of setcookie function is - it may be FALSE if output has been already sent before the function call. You did mention it is right at the start of your script, however there could be other entities outputting data (pre-executed scripts on the server perhaps?)

    It's also possible that your browser is set to not accept cookies from certain domain - check your configuration.

    Please provide any other relevant code and indicate how you check if cookies are set.

提交回复
热议问题