|
Posted by David Haynes on 06/19/06 00:38
Geoff Berrow wrote:
> Message-ID: <1150645209.331434.17340@f6g2000cwb.googlegroups.com> from
> TristaSD contained the following:
>
>> I tried to follow php.net manual to the best of my ability, but I'm
>> getting two errors now:
>>
>> Warning: session_start(): Cannot send session cache limiter - headers
>> already sent
>> Warning: Cannot modify header information - headers already sent by
>>
>> All I want to do is create a login page that starts the session, and a
>> logout page that destroys the session. I'm having a hell of a time.
> Logout.php
> <?php
> session_start();
> session_destroy();
> header("Location: login.php");
> exit;
> ?>
My logout is a little more involved:
<?php
require_once('autoload.inc');
require_once('redirect.inc');
session_start();
$sessionName = session_name();
$sessionCookie = session_get_cookie_params();
session_destroy();
setcookie($sessionName, false, $sessionCookie['lifetime'],
$sessionCookie['path'], $sessionCookie['domain'],
$sessionCookie['secure']);
redirect('/ctrl/login.ctrl.php');
?>
-david-
Navigation:
[Reply to this message]
|