php - Codeigniter - How to get Other user session -



i'm using chat in codeigniter here i'm tring active users can display in chat whether user online or offline. tried following result empty.

$this->session->all_userdata(); 

kindly me.

if using database sessions, potentially verify login status using call ci_sessions table (or whatever have named it). can use simple query validate if have been browsing within last hour (or whatever) , validate them being online.

sample sql query this:

select from_unixtime(timestamp) 'timestamp' ci_sessions timestamp > unix_timestamp(date_add(curdate(),interval -1 hour)) order timestamp desc 

this return users active in last hour (the timestamp col updated each time page requested)

you can grab users details out of 'data' column...

$this->session->all_userdata() 

will not return logged in users available data of current logged in user


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -