Welcome Guest, Not a member yet? Register   Sign In
CI 3 Release Candidate having huge problem in session
#1
Wink 

Hi,
I am using codeigniter 3 RC in my chatting system project. After upgading from CI 3 development version session driver not working as expected. My configuration is

database.php
Code:
'pconnect' => TRUE,
'save_queries' => FALSE

and config.php
Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'/'.'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;

There are huge ajax request in my app which are executing simutaneously. Now my problems is
** site working very slow after upgrading to CI 3 (RC) specially in ajax page's

I have tried using database driver instead of files, yet perfomance not improved

appreciate any help
The largest Bengali tutorial site on Web Development in this planet
Reply
#2

After a Research finally FOUND the solution:

session_write_close(); the tricks.

For long poll its need to close the session using session_write_close();

it will only close the active session but not destroy any session data
The largest Bengali tutorial site on Web Development in this planet
Reply
#3

The sessions reference (http://www.codeigniter.com/userguide3/li...sions.html) mentions that you shouldn't use a persistent connection. I haven't looked into the reasoning why, but that could be a possibility as well.
Reply
#4

Ignore that post, not enough coffee and too tired to realize you weren't using the database method for session saving. Smile apologies.
Reply
#5

(This post was last modified: 02-03-2015, 12:04 PM by spjonez.)

(02-01-2015, 11:14 PM)rejoan Wrote: After a Research finally FOUND the solution:

session_write_close(); the tricks.

For long poll its need to close the session using session_write_close();

it will only close the active session but not destroy any session data

Are you calling this manually in your own code or did you modify the built in session library? You should send a PR if it's the latter.
Reply
#6

(02-03-2015, 12:03 PM)spjonez Wrote:
(02-01-2015, 11:14 PM)rejoan Wrote: After a Research finally FOUND the solution:

session_write_close(); the tricks.

For long poll its need to close the session using session_write_close();

it will only close the active session but not destroy any session data

Are you calling this manually in your own code or did you modify the built in session library? You should send a PR if it's the latter.

in my code. but session documentation should mention that "must use session_write_close() when u have ajax long poll otherwise application will not work properly"
The largest Bengali tutorial site on Web Development in this planet
Reply
#7

(This post was last modified: 02-04-2015, 06:25 AM by Narf.)

(02-03-2015, 12:03 PM)spjonez Wrote:
(02-01-2015, 11:14 PM)rejoan Wrote: After a Research finally FOUND the solution:

session_write_close(); the tricks.

For long poll its need to close the session using session_write_close();

it will only close the active session but not destroy any session data

Are you calling this manually in your own code or did you modify the built in session library? You should send a PR if it's the latter.

No, please don't.

(02-03-2015, 11:13 PM)rejoan Wrote:
(02-03-2015, 12:03 PM)spjonez Wrote:
(02-01-2015, 11:14 PM)rejoan Wrote: After a Research finally FOUND the solution:

session_write_close(); the tricks.

For long poll its need to close the session using session_write_close();

it will only close the active session but not destroy any session data

Are you calling this manually in your own code or did you modify the built in session library? You should send a PR if it's the latter.

in my code. but session documentation should mention that "must use session_write_close() when u have ajax long poll otherwise application will not work properly"

It will be slow for for what you're trying to do with it, but not improper.
Reply
#8

(02-03-2015, 11:13 PM)rejoan Wrote: in my code. but session documentation should mention that "must use session_write_close() when u have ajax long poll otherwise application will not work properly"

When you say long polling are you using Socket.IO?
Reply
#9

(02-04-2015, 05:58 AM)spjonez Wrote:
(02-03-2015, 11:13 PM)rejoan Wrote: in my code. but session documentation should mention that "must use session_write_close() when u have ajax long poll otherwise application will not work properly"

When you say long polling are you using Socket.IO?

No. Its comet
The largest Bengali tutorial site on Web Development in this planet
Reply




Theme © iAndrew 2016 - Forum software by © MyBB