Newbie question, i have variables inside my class method, do i have to make them class variables where i can access them using $this? If no, please explain when do i use or make a class variables?
private function is_valid_cookie() { $securedtoken = $this->input->cookie('securedtoken'); // Checks if the cookie is set if (!empty($securedtoken)) { // Checks if the cookie is in the database $s = $this->db->escape($securedtoken); $query = $this->db->query("SELECT cookie_variable FROM jb_login_cookies WHERE cookie_variable=$s"); if ($query->num_rows() != 0) { // Now let us decrypt the cookie variables $decoded = unserialize($this->encrypt->decode($securedtoken)); $this->login($decoded['username'], $decoded['password']); return true; } else { return false; } } else { return false; } } as you guys can see, i have variables $securedtoken and $decoded = array(), i cant decide if i have to make them class variables and just access them with $this