Jump to content

[SOLVED] Not setting session varible's


nathanmaxsonadil

Recommended Posts

I have a login script that checks for error's and then if your password and username match the ones in the database it set's session variable's and then redirects you

however when I tried it redirected me but when I tried to echo the session variable it was blank :(

 

here's where I declare my session variable's in login.php

else if($row['password'] == sha1($_POST['password']) && $row['username'] == $_POST['username']) {
$_SESSION['username'] == $row['username'];
$_SESSION['email'] == $row['email'];
$_SESSION['loggedin'] == true;
$_SESSION['points'] == $row['points'];
echo "<script type='text/javascript'>
<!--
window.location = 'http://www.swapinvites.com/'
//-->
</script>";
}

 

and here's where I echo loggedin

<?php
session_start();
echo $_SESSION['loggedin'];
?>

Link to comment
https://forums.phpfreaks.com/topic/65525-solved-not-setting-session-varibles/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.