Session cookie and www

前端 未结 5 988
南方客
南方客 2021-01-25 18:04

I would like to have my session work in my website when using www. AND when not using it. I\'ve read this thread: PHP cookie problem - www or without www

And this would

5条回答
  •  滥情空心
    2021-01-25 18:35

    Use session_set_cookie_params function before calling session_start, it allows you to set the session domain and other things, set the domain to your domain prefixed with a . to make the session available to subdomains as well.

提交回复
热议问题