Jump to content

Cannot send session cache limiter !?


proud

Recommended Posts

I dont know what is wrong with this piece of code, although i get the message

(Welcome, you are still logged in) which means that the code has worked besides it i get this error message:

 

Warning:Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\checkLogin.php:2) in C:\AppServ\www\checkLogin.php on line 5

Welcome, you are still logged in.

 

 

this is my code for the page checklogin.php:

 

<?php

 

//start the session

session_start();

 

//check to make sure the session variable is registered

if(session_is_registered('username')){

 

//the session variable is registered, the user is allowed to see anything that follows

 

echo 'Welcome, you are still logged in.';

 

}

else{

 

//the session variable isn't registered, send them back to the login page

header( "Location: login.htm" );

}

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.