[eluser]zee[/eluser]
Although its an old thread, I am under the same problem.
I am using the same method as shown in post#7 but still the session values show up as 'set'. I used both isset() and empty().
Code:
$logindata = $this->session->userdata('username');
if(isset($logindata)){
echo "session is set";
}
else echo "session not set";
I tried to echo $logindata but it is blank. And I am using session in autoload (CI 2.1). Does that affect this behaviour?
As far as I think, $logindata is no more unset or empty as we have set it as $this->session->userdata('username') which is NULL. So it is no more unset/empty, but will echo null value and hence shows as blank.
So what is the solution to check if a session is set?