codeigniter


CodeIgniter sess_destroy does not delete user_data session?


I am creating test case for my CodeIgniter app. However I just found something that I thought should not be happen :
in login.php controller :
public function logout()
{
$this->session->sess_destroy();
redirect('/');
}
So I just created a test to just make sure that session is really destroyed :
public function test_logout()
{
$this->CI = set_controller('login');
// make sure that all session is destroyed
$this->CI->session->set_userdata('test_session', 'some_value');
$this->CI->logout();
// userdata 'test_session' should be removed!
$this->assertTrue(($this->CI->session->userdata('test_session')==null || $this->CI->session->userdata('test_session')==''));
}
However I find that upon running the test case, my test case fails! Upon debug on the last line of test case, I found that the userdata is still exist with value = 'some_value'. I thought that sess_destroy should also delete all the set user data, as per what they described in their website documentation:
This function should be the last one called, and even flash variables will no longer be available. If you only want some items destroyed and not all, use unset_userdata().
I am using Kenji's CIUnit for unit testing.
Is this the correct behaviour or is there something that I missed?
Just found that CIUnit routes the Session to CIU_Session instead of original CodeIgniter's CI_Session. It miss a line that CI_Session does :
$this->userdata = array();
So turns out this is CIUnit's issue instead of CodeIgniter's. Create an issue in their bitbucket page.

Related Links

How to load blocktrail api in codeigniter
code igniter $this->form_validation->run() always returns false
Events are not rendered when retrieving them from Google Calendar JSON encoded
Removing link from botdetect captcha in code igniter
How to debug “Missing argument 1 for Skill::delskill”?
Access base_url() Or site_url() in CodeIgniter's custom config file
Xdebug in PhpStorm cannot locate extended classes
Is it safe to use session in codeigniter?
Cannot use object of type stdClass as array in pcategories.php
How to integrate PHPBB3 or MYBB3 with codeigniter
Bulk upload Proceed codeigniter
Custom Pagination Page Count Message
Codeigniter update functions updates all rows
CodeIgniter mysqli - An Error Was Encountered Invalid DB driver
codeigniter data not showing when entering $user_id and data is showing when putting directly user_id no which is “1”
How to integrate Codeigniter 3 framework with netbeans 8 or any version completly

Categories

HOME
whatsapp
rtmp
path
styling
asana
bootstrap-selectpicker
wxpython
visual-studio-2012
go-gorm
telnet
cross-compiling
obiee
editor
rebus
pyfftw
libssh
plc
amplitude
missingmethodexception
profiling
digital-logic
stylesheet
mathdotnet
jtable
angular-ngmodel
akka-http
charts.js
cloudinary
tensor
server-sent-events
extraction
docker-image
decompiler
disqus
drupal-webform
extjs4
jquery-ui-dialog
move
strip-tags
vega-lite
abbyy
sshd
lcov
plotrix
tachyon
coldfusion-11
webtrends
data-fitting
rsh
webclient-download
kernighan-and-ritchie
python-3.1
angularjs-filter
benerator
yapdatabase
occam-pi
domo
laravel-forge
ironmq
polygons
user-registration
multiscreen
scalariform
emberfire
zim-database
vendor
horizontalscrollview
opensc
imaging
knockout-mvc
directcompute
pkcs#10
nine-patch
declspec
mongo-shell
transport-stream
prudentia
rcu
nsmanagedobjectmodel
osmf
dependency-walker
dynamic-usercontrols
google-website-optimizer
jscience
ssao
coolstorage
nsindexset
automapping
n900
xtratreelist
non-relational-database
docking

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App