Hello all,
I have tried to fix this many a time before but never managed it. However now it is really annoying me as it clogs up my error file.
<?php
session_start();
session_register('sid');
if (isset($_SESSION['sid'])) {
} else {
$tmp = md5(microtime());
$_SESSION['sid']=$tmp;
}
$db_server = "server";
$db_name = "name";
$db_user = "user";
$db_passwort = "pw";
$db = @MYSQL_CONNECT($db_server,$db_user,$db_passwort) or die ("no connection please contact me");
$db_check = @MYSQL_SELECT_DB($db_name);
?>
This little file is called from every page on my website and is causing this line to appear lots
What is the correct way of setting the session i.e. how do I correctly start it at a given point and then keep it throughout?
From my understandin in the older php versions I could have just used session_register('sid'); and didn't need the start (but if I did that then had error) while now I have just read that the session_register('sid') has been removed as of 5.4.0.
Help would be muchly appreciated, I don't use php that often, just made my site work in the beginning and ignored this but it annoyed me the other day when I saw the size of the error file.
thank you
Waliser