CodeIgniter Forums
Session Class in CI 1.7.0 run the update but not actualize the register - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Session Class in CI 1.7.0 run the update but not actualize the register (/showthread.php?tid=17253)

Pages: 1 2


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-30-2009

[eluser]Nonox[/eluser]
Hi, I have a question about the Session Class in CI 1.7.0, I can see with
Code:
$this->output->enable_profiler(TRUE);
that the update is running:

Example:
Code:
UPDATE `ci_sessions` SET `last_activity` = '1238472345', `user_data` = 'a:1:{s:13:\"flash:new:uri\";s:
19:\"/site/registro/alta\";}' WHERE `session_id` = '65d86464ace6d9c8e69e7bef887ef713'


But, when I go to the database the register `session_id` = '65d86464ace6d9c8e69e7bef887ef713' have the user_data filed empty.

Someone can help me? If you need more information please tell me.

Thanks.
Nonox


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]Wuushu[/eluser]
I seem to have this same problem. Whenever I have profiling turned on, flash data does not get written to the DB, only displayed in the profiling section. If i turn profiling OFF, the data is then again correctly written in the sessions table. Smile CI 1.7.1 here by the way.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]TheFuzzy0ne[/eluser]
I've found that slashes can sometimes break sessions.

Code:
'a:1:{s:13:\"flash:new:uri\";s:19:\"/site/registro/alta\";}'

The userdata is stored in single quotes, but for some reason, double quotes are still escaped. Very strange...

This may not be the issue, but I wouldn't be surprised if as I said before, it has something to do with those slashes.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]Nonox[/eluser]
mmm... In my case I think the problem is another, for some reason in some moment other action is updating the field user_data, I fixed the problem temporarily not using the flashdata.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]TheFuzzy0ne[/eluser]
Sounds like it could be a problem in your code. What queries does the profiler show?


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]Nonox[/eluser]
Is true, looks like a problem in my code, this are the queries showed by the profiler:

Code:
SELECT *
FROM (`ci_sessions`)
WHERE `session_id` = 'e38febc249ac1f9fad1b72c45b2ac832'
AND `ip_address` = '9.18.96.54'
AND `user_agent` = 'Mozilla/5.0 (X11; U; Linux i686; es-AR; rv:1.9.0.8'  

UPDATE `ci_sessions` SET `last_activity` = '1238538682', `user_data` = 'a:1:{s:13:\"flash:new:uri\";s:19:\"/site/registro/alta\";}' WHERE `session_id` = 'e38febc249ac1f9fad1b72c45b2ac832'  

INSERT INTO `captcha` (`captcha_id`, `captcha_time`, `ip_address`, `word`) VALUES ('', 1238527923.42, '9.18.96.54', 'fervoris')  

SELECT * FROM country ORDER BY description

But, I'm loading some part of the code with ajax and this query are not showed by the profiler.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 03-31-2009

[eluser]TheFuzzy0ne[/eluser]
[quote author="Nonox" date="1238546336"]But, I'm loading some part of the code with ajax and this query are not showed by the profiler.[/quote]

Ajax requests will be in a separate request.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 04-01-2009

[eluser]Nonox[/eluser]
I'm making the ajax request with Ajax.Updater (prototype), What do you suggest?


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 04-01-2009

[eluser]TheFuzzy0ne[/eluser]
The only solution really, is to log the output of the profiler, and try to find a way to group them together (you should be able to do this partly with the user's session ID). If you're doing this on a development server, it will be quite simple, on a production server with lots of requests, it won't be, but obviously, the profiler is only meant to be used on a development server, or at a push, in the admin section of a production Web site.


Session Class in CI 1.7.0 run the update but not actualize the register - El Forum - 04-01-2009

[eluser]davidbehler[/eluser]
Are you tryting to save flash data?
Flash data is only available until the next request and the next request would be your ajax request and after that the flash data is deleted.

Or am I wrong here? I admit I have not read all posts Wink