CodeIgniter Forums

Full Version: Session Class in CI 1.7.0 run the update but not actualize the register
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

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

El Forum

[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
Pages: 1 2