Jump to content

Users conflit!!!


raymyster

Recommended Posts

I am having complaints around my website that users are facing a prblem when they browse from one page to another users close o there area are the ones who are showing rather then theres, tat taking into consideration tat they are the ones who logged in with there usernae & password :S

the code is as following:

 

// THIS METHOD SETS USER LOGIN COOKIES

// INPUT: $persistent (OPTIONAL) REPRESENTING WHETHER THE COOKIES SHOULD BE PERSISTENT OR NOT

// OUTPUT:

function user_setcookies($persistent = 0) {

 

  $cookie_id = $cookie_email = $cookie_password = "";

  if(!empty($this->user_info) && !empty($this->user_info['user_email']) && !empty($this->user_info['user_id']) && !empty($this->user_info['user_password'])) {

    $cookie_id = $this->user_info['user_id'];

    $cookie_email = crypt($this->user_info['user_email'], $this->user_salt);

    $cookie_password = $this->user_info['user_password'];

    if($persistent == 0) { $cookie_time = 0; } else { $cookie_time = time()+3600; }

  } else {

    $cookie_time = time()-3600;

  }

 

  setcookie("user_id", $cookie_id, $cookie_time, "/");

  setcookie("user_email", $cookie_email, $cookie_time, "/");

  setcookie("user_password", $cookie_password, $cookie_time, "/");

 

} // END user_setcookies() METHOD

 

 

What should i do??????????????????????

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/
Share on other sites

I am having complaints around my website that users are facing a problem when they browse from one page to another users close to their area are the ones who are showing rather then there’s, that taking into consideration that they are the ones who logged in with their username & password in the first place…

 

 

Sorry new keyborad :D

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-515749
Share on other sites

<?php

function user_setcookies($persistent = 0) {
     
     $cookie_id = $cookie_email = $cookie_password = "";// what does this line do?
     if(!empty($this->user_info)||isset($this->user_info)||!
empty($this->user_info['user_email'])||isset(($this->user_info['user_email'])
     ||isset($this->user_info['user_id'])|
|!empty($this->user_info['user_id'])||isset($this->user_info['user_password'])||
     !empty($this->user_info['user_password'])) {
       $cookie_id = $this->user_info['user_id'];
       $cookie_email = crypt($this->user_info['user_email'], $this->user_salt);
       $cookie_password = $this->user_info['user_password'];
       if($persistent == 0) { $cookie_time = 0; } else { $cookie_time = time()+3600; }
     } else {
       $cookie_time = time()-3600;
     }

     setcookie("user_id", $cookie_id, $cookie_time, "/");
     setcookie("user_email", $cookie_email, $cookie_time, "/");
     setcookie("user_password", $cookie_password, $cookie_time, "/");

   } // END user_setcookies() METHOD


?>

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-515769
Share on other sites

yes remove it please ;D

 

<?php

function user_setcookies($persistent = 0) {
     


if(empty($this->user_info)||empty($this->user_info['user_email'])||
empty($this->user_info['user_id'])){ echo "Data is Empty";}

     else if(!empty($this->user_info)||isset($this->user_info)||
!empty($this->user_info['user_email'])||isset(($this->user_info['user_email'])
     ||isset($this->user_info['user_id'])||!empty($this->user_info['user_id'])
||isset($this->user_info['user_password'])||
     !empty($this->user_info['user_password'])) {
       $cookie_id = $this->user_info['user_id'];
       $cookie_email = crypt($this->user_info['user_email'], $this->user_salt);
       $cookie_password = $this->user_info['user_password'];
       if($persistent == 0) { $cookie_time = 0; } else { $cookie_time = time()+3600; }
     } else {
       $cookie_time = time()-3600;
     }

     setcookie("user_id", $cookie_id, $cookie_time, "/");
     setcookie("user_email", $cookie_email, $cookie_time, "/");
     setcookie("user_password", $cookie_password, $cookie_time, "/");

   } // END user_setcookies() METHOD


?>

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-515783
Share on other sites

<?php

function user_setcookies($persistent = 0) {
     $cookie_id = $cookie_email = $cookie_password = "";
if(empty($this->user_info)||empty($this->user_info['user_email'])||
empty($this->user_info['user_id'])){ echo "Data is Empty";}

     else if(!empty($this->user_info)||isset($this->user_info)||
!empty($this->user_info['user_email'])||isset(($this->user_info['user_email'])
     ||isset($this->user_info['user_id'])||!empty($this->user_info['user_id'])
||isset($this->user_info['user_password'])||
     !empty($this->user_info['user_password']))) {
       $cookie_id = $this->user_info['user_id'];
       $cookie_email = crypt($this->user_info['user_email'], $this->user_salt);
       $cookie_password = $this->user_info['user_password'];
       if($persistent == 0) { $cookie_time = 0; } else { $cookie_time = time()+3600; }
     } else {
       $cookie_time = time()-3600;
     }

     setcookie("user_id", $cookie_id, $cookie_time, "/");
     setcookie("user_email", $cookie_email, $cookie_time, "/");
     setcookie("user_password", $cookie_password, $cookie_time, "/");

   }// END user_setcookies() METHOD


?>

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-515997
Share on other sites

/ THIS METHOD VERIFIES LOGIN COOKIES, SETS APPROPRIATE OBJECT VARIABLES, AND UPDATES LAST ACTIVE TIME

// INPUT:

// OUTPUT:

function user_checkCookies() {

  global $database, $setting;

 

  if(isset($_COOKIE['user_id']) & isset($_COOKIE['user_email']) & isset($_COOKIE['user_password'])) {

 

    // GET USER ROW IF AVAILABLE

    $user_id = $_COOKIE['user_id'];

    $this->se_user(Array($user_id));

 

    // VERIFY USER EXISTS, LOGIN COOKIE VALUES ARE CORRECT, AND EMAIL HAS BEEN VERIFIED - ELSE RESET USER CLASS

    if($this->user_exists == 0 | $_COOKIE['user_email'] != crypt($this->user_info[user_email], $this->user_salt) | $_COOKIE['user_password'] != $this->user_info[user_password] | ($this->user_info[user_verified] == 0 & $setting[setting_signup_verify] != 0)) {

      $this->user_clear();

    }

  }

 

  // IF USER LOGGED IN, UPDATE LAST ACTIVITY

  if($this->user_exists != 0) {

    $time_current = time();

    $database->database_query("UPDATE se_users SET user_lastactive='$time_current' WHERE user_id='".$this->user_info[user_id]."'");

  }

 

} // END user_checkCookies() MET

 

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-515999
Share on other sites

<?php

function user_setcookies($persistent = 0) {
     $cookie_id = 0;
     $cookie_password= 0;
     $cookie_time= 0;


     if($cookie_id=='NULL'||$cookie_password=='NULL'||$cookie_time=='NULL') {Return TRUE;} else{ return FALSE;}
     
if(empty($this->user_info)||empty($this->user_info['user_email'])||
empty($this->user_info['user_id'])){ echo "Data is Empty";}

     else if(!empty($this->user_info)||isset($this->user_info)||
!empty($this->user_info['user_email'])||isset($this->user_info['user_email'])
     ||isset($this->user_info['user_id'])||!empty($this->user_info['user_id'])
||isset($this->user_info['user_password'])||
     !empty($this->user_info['user_password'])) {
       $cookie_id = $this->user_info['user_id'];
       $cookie_email = crypt($this->user_info['user_email'], $this->user_salt);
       $cookie_password = $this->user_info['user_password'];
       if($persistent == 0) { $cookie_time = 0; } else { $cookie_time = time()+3600; }
     } else {
       $cookie_time = time()-3600;
     }

     setcookie("user_id", $cookie_id, $cookie_time, "/");
     setcookie("user_email", $cookie_email, $cookie_time, "/");
     setcookie("user_password", $cookie_password, $cookie_time, "/");

   }// END user_setcookies() METHOD


?>

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-516001
Share on other sites

also Try folling the Guidelines

 

1.) Post In The Right Forum

 

2.) Ask Good Questions

 

3.) Never Ask Someone to Program or Rewrite a script for you.

 

 

If your programmer is wonderinfg.why he was banned he should have followed this, instead of whining about it to me on MSN.

 

 

Link to comment
https://forums.phpfreaks.com/topic/100854-users-conflit/#findComment-516085
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.