CodeIgniter Forums
CI 3 Release Candidate having huge problem in session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: CI 3 Release Candidate having huge problem in session (/showthread.php?tid=957)



CI 3 Release Candidate having huge problem in session - rejoan - 02-01-2015

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


RE: CI 3 Release Candidate having huge problem in session - rejoan - 02-01-2015

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


RE: CI 3 Release Candidate having huge problem in session - jeturner90 - 02-02-2015

The sessions reference (http://www.codeigniter.com/userguide3/libraries/sessions.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.


RE: CI 3 Release Candidate having huge problem in session - jeturner90 - 02-02-2015

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


RE: CI 3 Release Candidate having huge problem in session - spjonez - 02-03-2015

(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.


RE: CI 3 Release Candidate having huge problem in session - rejoan - 02-03-2015

(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"


RE: CI 3 Release Candidate having huge problem in session - Narf - 02-04-2015

(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.


RE: CI 3 Release Candidate having huge problem in session - spjonez - 02-04-2015

(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?


RE: CI 3 Release Candidate having huge problem in session - rejoan - 02-05-2015

(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