You can use var_dump()
to output the session. Something like this
var_dump($this->session);
The set_userdata
call looks ok. Are you sure $user_id
is set. Because the echo is surley executed but uid
isn't set or set to empty string.
Try replacing the echo with
echo ':test_'.$this->session->userdata('uid').'_test:';
Other information helpful for answering
- What browser are you using?
- Do you have an underscore
_
in your domain name? - Are you using CI sessions or some wrapper for native PHPsessions
- Is the value for
uid
also lost/not set when you comment out the redirect?
Other suggestions:
- try
redirect('/preferences/index/', 'refresh');
instead oflocation
- I'm not familiar with facebook development but is
/preferences/index
under your control? If yes try removing (if present)$this->load->library(‘session’)
and instead load it inautoload.php
. - try changing
$config[‘sess_match_ip’]
to `FALSE - try setting
$config[‘sess_encrypt_cookie’]
to FALSE - try replacing the use of CI-Session with CI Native session
- Is UID sensible information if not store it in a cookie. If it matters if it can be spoofed don't.
jitter
2009-10-22 22:06:26