PHP Session Id Changing on Every Request

PHP Session Id changes between pages

According to PHP documentation, session_start must be called before any output is sent back to the browser-- could this page have a rogue CR/LF, Unicode byte-order mark or similar that is causing output before you include('session-inc.php')?

PHP changes session ID on each request

Install some software watching HTTP headers like

  • Live HTTP Headers Firefox addon https://addons.mozilla.org/en-us/firefox/addon/live-http-headers/
  • WireShark sniffer http://www.wireshark.org/

    and check whether

    1. Server sends the cookies as it should
    2. Browser sends them back.

Probably the Cookie header contains settings which make Browser not to send it back, and therefore server generates a new cookie (new session) for every request.
Especially check the path setting of the cookie you send.

Also, it might be some new policy in browser, or a security plugin, or maybe antivirus... try different browser, or bare curl program, and disable web shield of your antivirus if applicable.



Related Topics



Leave a reply



Submit