session help
<?php
session_start();
include("connect.php");
$username1 = $_SESSION['username'];
if (!isset($_SESSION['$username'])) {
echo "Sorry Your Not Logged In" . $_session['username'];
exit();
}
else if (isset($_GET['logout'])) {
session_destroy();
echo "You Have Been Successfully Logged Out";
}
?>
else if the logout button was pressed destroy the session and echo success pretty straight forward
now if I change that and echo out that $username1 = $_SESSION['username'] echos fine so that tells me that the session is set ??? dosn't it?
issue is i'm always getting the sorry your not logged in but not the username??
what am I doing wrong here?
-
Brad Hodge -
Thanks - 1 reply
SignatureTop Rated Upwork Freelancer with 250+ Jobs{{ DiscussionBoard.errors[6144987].message }}-
aisdbuilder -
[ 1 ] Thanks - 1 reply
{{ DiscussionBoard.errors[6148777].message }}-
Cosmit -
Thanks
SignatureBanks Hate Him! See how he made $10,000 in an afternoon with one simple trick!{{ DiscussionBoard.errors[6149961].message }} -
-
-
-
Earnie Boyd -
[ 1 ] Thanks
SignatureEarnie Boyd{{ DiscussionBoard.errors[6153121].message }} -
-
jminkler -
Thanks
{{ DiscussionBoard.errors[6155522].message }} -
-
jminkler -
Thanks
{{ DiscussionBoard.errors[6155532].message }} -