Hi everyone,

I have had the current users sessions set up for three days now and today for no reason what so ever the sessions have now stoppped working. I have no idea but if i echo the session it shows but wont pass through pages on my site. Please help, thanks in advance and heres the code im using on the login page:

if ($getprocess == "login") {
			
			include("includes/db_connect.php");
			$username = $_POST['username'];
			$password = $_POST['password'];
			
			$checkusername = mysql_query("SELECT * FROM users where username = '$username' AND password = '$password'");
			$username_exists = mysql_num_rows($checkusername);
			
			if ($username_exists == "1") {
				$_SESSION['user'] = $username;
				//mysql_query("UPDATE users SET `status` = 'Online' WHERE username='$username'");
				//echo "You have been logged in, Redirecting You...";
				//echo('<meta http-equiv="refresh" content="0;url=http://www.jtagheaven.co.uk">');
			} else {
				echo("You have entered a wrong username or password. Click <a href='login.php'><font color='white'><u>here</a></u></font> to try again unless you have forgotten you password in which case click <a href='forgot-pass.php'><font color='white'><u>here</u></a></font>.");

PS i know about the end if statements these are further on but thats all u need. Thanks again...

you need to add the following to the top of the page inside the php tags

session_start();
ob_start();
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.