I have implemented a loging system using sessions. It was working fine till last week. Suddenly some problems occered. I dont remember me making any changes to the code. so, i can not figure out what caused these problems...
To be more specific, a user logs in through a form (of course), a query searches my mysql database and if the username and password exists the system executes the code:
Code: Select all
session_regenerate_id();
session_register("authenticated");
$member = mysql_fetch_assoc($result);//the query executes ok
$_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
$_SESSION['SESS_FIRST_NAME'] = $member['firstname'];
$_SESSION['SESS_LAST_NAME'] = $member['lastname'];
$_SESSION['SESS_CLASS'] = $member['class'];
$_SESSION['SESS_FATHERSNAME'] = $member['fathersname'];
$_SESSION['SESS_LOGIN'] = $member['login'];
session_write_close();
Just as simple as that. So, if the username and password are ok i hide the form and i echo the message hallo username...
That code was and still is workng ok but not all of the times!!!! Many times i have to refresh the page more than once in order to see the hallo message and dissapear the login form which are the proofs for my succesfull login..
IT is very odd.
I am thinking that it is a server side problem because i did not make any code changes. I can not thing anything that i should try in order to fix it. Do u thing i should communicate with the company that hosts my page? I dont really know what to ask them for.......