PHP Sessions with disabled cookies, does it work?

前端 未结 9 1842
暖寄归人
暖寄归人 2020-11-28 03:58

Today I had skype interview for a job as PHP developer, one of the questions asked was about Cookies and PHP Sessions.

The question was, can PHP session be set and r

9条回答
  •  猫巷女王i
    2020-11-28 04:28

    If session.use_cookies = 1 (Cookie enabled.)

    If session.use_cookies = 0 (Cookie disabled.)

    If session.use_cookies = 1 then session stores the sessionId into cookie. Calling session_id() get the stored sessionId from cookie and saved data into session array will be found on all the pages. If session.use_cookies = 0 In this case session does not store sessionId into cookie and you will get each time a new sessionId using session_id() and data stored into session on other pages will not be found on another pages.

提交回复
热议问题