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
- Server sends the cookies as it should
- 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
Pdoexception' with Message 'Sqlstate[22001]: String Data, Right Truncated: 0
Cannot Initialize Mbstring with PHP 7
Fatal Error: Uncaught Argumentcounterror: Too Few Arguments to Function
In PHP, Is There Any Harm in Running Session_Start() Multiple Times
Laravel 5.1 Date_Format Validation Allow Two Formats
How to Use MySQL Found_Rows() in PHP
How to Upload Image PHP and Insert Path in MySQL
Notice: Undefined Index: Http_Referer
If Statement Within an Array Declaration ...Is That Possible
Multidimensional Array Difference PHP
Php's Function to List All Objects's Properties and Methods
Saving Div Contents or Canvas as Image
Use Variable as Function Name in PHP
Troubleshooting "Unexpected T_Echo" in Ternary Operator Statement