Welcome Guest, Not a member yet? Register   Sign In
$this->session->userdata('user_id') returning blank [Using Uploadify]
#1

[eluser]markanderson993[/eluser]
Solved! http://ellislab.com/forums/viewthread/150550/

Edit* I should add that I am using uploadify and upload_facevide() is being called from it.

Hello again Codeigniter experts! So I found a strange problem while trying to fetch session information inside a controller method:
Code:
function upload_facevideo() {
    
        if (!empty($_FILES)) {
            // Get user folder
            
            $user_id = $this->session->userdata('user_id');
            echo 'user id is ' . $user_id;

            
        }
    }

I would always get "user id is" and no number. I know for a fact that there is a user_id field and it does fetch properly when in this context:
Code:
function test() {
        $user_id = $this->session->userdata('user_id');
        echo $user_id;
    }

Does anybody know why this is happening? I am extremely puzzled!

Thanks in advance for any help![/b]http://ellislab.com/forums/viewthread/150550/
#2

[eluser]Dennis Rasmussen[/eluser]
Session library loaded both places?
They seem identical.
#3

[eluser]markanderson993[/eluser]
Thanks Dennis for your quick response,

The session library is auto-loaded. I just edited my first post by saying that I am using uploadify and the strange behavior only occurs from the method upload_facevide() that it calls.
#4

[eluser]markanderson993[/eluser]
I believe I found a solution! http://ellislab.com/forums/viewthread/150550/




Theme © iAndrew 2016 - Forum software by © MyBB