Hello.
Wrote an authorization script. Filled on the home computer - it works. Filled on a hosting - does not work. Found that on the hosting when you refresh the page and move from one to another, the session id is constantly changing. On a home computer, this does not happen.
Home computer
Hosting website
Source pages are available on the home computer at the links:
config
create
login
index
Login to check temoffey, password 123456.
Please help me understand what the reason for this behavior.
Thank you in advance.

  • The question is closed. I called tech support for hosting, they have disabled register_globals. I do not know how connected, but it helped. - temoffey

1 answer 1

session_start() on php.net

To use cookie-based sessions, session_start () must be called before outputting anything to the browser.

This function must be called before any output .

You do not have it "different", it is simply not installed.

 <? session_start(); // code, code, code... ?> <!DOCTYPE ... 

It is possible that you have forced caching with a large buffer on your home computer, but not on the hosting.

  • Changed the code. Brought session_start () to the very top of the page. Nothing has changed, it works at home, on the hosting - no. - temoffey