hallo there,

i ve implemented a log in system which works just fine. i have a simple form username and psw and when the user pushes the button "ok" i check into mysql database if those names exists. if yes, i create a session and i keep some variables so i can use them later.
the code

$qry="SELECT * FROM members WHERE login='$login' AND passwd='$password'";

$result=mysql_query($qry);
	
	//Check whether the query was successful or not //////////////////////'".md5($_POST['password'])."'";
	if($result) {
		if(mysql_num_rows($result) == 1) {
session_regenerate_id();
session_register("authenticated"); 
$member = mysql_fetch_assoc($result);
$_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_write_close();

i had no problem at all till i realized it today.
when someone is logged in he should fill in some forms. this may take a while. if the user is too late doing that, i am not sure for how long, he can not sudmit the form because he is no longer logged in...... the system shows exception and errors.

what can i do so the user may stay longer logged in???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.