Welcome Guest, Not a member yet? Register   Sign In
Sessions WTF
#1

[eluser]Phil Sturgeon[/eluser]
Got a real odd one here. If im just being an idiot then make your jokes and get it over and done with, at least its fixed.

Code:
function report($videoID)
    {
    
        $this->load->library('session');
        $this->load->library('user_agent');
        $this->session->set_userdata('reported_'.$videoID, true);
        // If there isnt a session saying this game is already voted on
        if($this->session->userdata('reported_'.$videoID) !== true and !$this->agent->is_robot()):
        
            $this->load->model('video_model');
            
            // Then set their new vote
            if($this->video_model->report($videoID)):
                $this->session->set_userdata('reported_'.$videoID, true);    
            
                $this->data['message'] = 'This game has been reported. A moderator has been notified and action should be taken very soon.';
            else:
                $this->data['message'] = 'This game could not be reported for some reason. Please try again at a later time.';
            endif;
        else:
            $this->data['message'] = 'Sorry, you have already reported this video. A moderator has been notified, reporting a second time will have no effect.';
        
        endif;
        
        echo 'test:'.$this->session->set_userdata('reported_'.$videoID);    
        
        $this->template->title("Videos > Video Reported");
        $this->template->create("videos/message", $this->data);
    
    }

For SOME reason its not setting the session... why? I get the message:

Quote:This game has been reported. A moderator has been notified and action should be taken very soon.

every damn time and it always reports it!


Messages In This Thread
Sessions WTF - by El Forum - 08-07-2007, 12:10 PM
Sessions WTF - by El Forum - 08-07-2007, 02:44 PM
Sessions WTF - by El Forum - 08-07-2007, 02:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB