I see. So I moved session_start() to the beginning of the html script, and included an output buffer. It looks like this: <?php ob_start(ob_gzhandler); //starts output buffer, compresses HTML session_start(); ?> <html> <head> . . . Then, in login_form.php (which is included on this index page), I deleted session_start() since it is initiated at the start of the html script (and produced error messages when it was in the middle of the conditional statement): if($login && $password) { if (mysql_num_rows($check_login)) { // session_start(); $_SESSION ['login'] = $data['login']; echo '<script language="javascript">location.href="first_page.php"</script>'; exit; } It seems to work: the page redirects upon logging in, there's no error message, the session seems to be remembered. Thanks so much for the coding tips. They were extremely useful!!