Welcome Guest, Not a member yet? Register   Sign In
synchronize different sessions when events happened.
#1

[eluser]Trankh1[/eluser]
Hello,

I'm writing a social networking application and I want to synchronize different sessions.

My context is following:

userA is logged and has an array of his contacts in session.
userB is logged and has an array of his contacts in session.

userA adds userB as a contact.
So, Contact table (DB) sees a new record
And userA has an update of his array of contacts (easy because the event happens on userA navigation side)

My need is following:

I want now to synchronize automatically userB's session so that his array of contacts is refreshed
without doing a sql query to check the contacts table (db). I want that in order to avoid making too many sql queries to check that.

Do you have any suggestions?

I'm using CodeIgniter last version and the session is managed with database.

Code:
$config['sess_cookie_name']             = 'ci_session';
$config['sess_expiration']              = 0;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = TRUE;  
$config['sess_use_database'] = TRUE;
$config['sess_table_name']              = 'ci_sessions';
$config['sess_match_ip']                = FALSE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update']  = 300;

Thanks a lot




Theme © iAndrew 2016 - Forum software by © MyBB