Looping Through All a Server's Sessions in PHP

前端 未结 4 1891
温柔的废话
温柔的废话 2020-11-28 04:55

Is there a way in PHP to get a list of all sessions (and the variables within each) on the server?

Basically, we have a maintenance function which needs to know whic

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 05:12

    I used the @mgroat method in the ajax call, but there is a problem in the header of the HTTP response that the Set-Cookie header appears multiple times and jQuery reports an error:

    Set-Cookie header is ignored in response from url: mysite.com/admin/ajax/main_ajax. Cookie length should be less than or equal to 4096 characters.

    The solution is to add header_remove("Set-Cookie") right after session_start().

提交回复
热议问题