Jump to content

HELP in session checking


sweeti

Recommended Posts

Hey everyone..

I cleared the earlier doubt i have a new doubt in the same system..

 

<code>

public function login($uname, $pass,$remember=false)

{

$result =$this->db->query("SELECT * FROM tbl_userauth");

$result->execute();

$resl=$result->fetchAll(PDO::FETCH_ASSOC);

if ($resl[0]['username'] !=$uname || $resl[0]['password']!=$pass)

{

return $this->error("User not Found");

}

else

{

    $userID=$resl[0]['userid'];

    $_SESSION['userid']=$userID;

 

      $uname=$resl[0]['username'];

      $_SESSION['uname']=$uname;

 

  if(isset($_SESSION['userid']))

 

    {

    header("location:dash.php");

    }

    else

    {

 

    header("location:login.php");

    }

 

</code>

 

 

No this is my system actually i wanted to do session checking..Rite now when i am logging in the system i am able to log in but the same URL if i copy and paste in another browser i dont have to log in i am already logged in that's not rite Na??

I mean in another browser i should b logging in and then able to access in rite????What am i doing wrong????

PLease guide me through..Thank you..

Link to comment
https://forums.phpfreaks.com/topic/261225-help-in-session-checking/
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.