PHP: what is the purpose of session_name

前端 未结 2 1839
眼角桃花
眼角桃花 2020-12-06 04:06

I\'m not quite sure what the purpose of session_names is.. Can someone please explain in what circumstances defining a name would be beneficial?

2条回答
  •  再見小時候
    2020-12-06 04:50

    You have two sites on the same domain. (say, a blog and a forum)

    They both run different pieces of software.

    If they ran on the same session and used the same variables in $_SESSION, (say, user_id), they would conflict.

    session_name lets you give each application a different session.

提交回复
热议问题