Forums

Joomla session not stored in database

hugues.lamy 12 May, 2009
I must say that a strike a bad luck this time.
I used Chronoforms once in a while for projects and liked it.

This time I tried to store the Joomla session using the following in the unsubmit code of the form
<?php
$session = &JSession::getInstance();
$session_id = $session->getId();

JRequest::setVar( "session_id", $session_id);
?>


As you see, I created a field in the database called session_id to store the session in order to help me keep track of the guest user along many forms they will navigate on the site..

It look like chronoforms is blanking this exact value. Maybe it was a leftover of another version, but as soon as I change the code and the database for something else... like u_sess_id it start to work.

I haven't got the time to search the code, maybe I missed a setting somewhere to store the Joomla session. I would have thought that this value would be store in the database as well as the UID, CD_USER_ID and so on.

Thanks.

Hugues Lamy - http://m2i3.com
GreyHead 12 May, 2009
Hi Hugues,

As far as I remember there's nothing in ChronoForms that would stop you saving the session_id. The code you have there will just be executed. Does the session_id have a value before you use setVar??

Bob
hugues.lamy 13 May, 2009
I was able to save the session id of Joomla, but not in database column named session_id.
I got from :
<?php
$session = &JSession::getInstance();
$session_id = $session->getId();

JRequest::setVar( "session_id", $session_id);
?>


to:
<?php
$session = &JSession::getInstance();
$session_id = $session->getId();

JRequest::setVar( "u_sess_id", $session_id);
?>


I soon as I change it for the other name, everything just worked.

I'll dig into this. My best guess is that something was left from an older version of ChronoForms. I remember vaguely, to have the session_id in the database. I could be wrong too.

Have a good day.

Hugues
Max_admin 14 May, 2009
Hi Hugues,

maybe the session_id variable is used somewhere else and changed in the Joomla framework, it should be safer to use another one, like my_session_id

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hugues.lamy 15 May, 2009
Thanks Max.

I scan the code, nothing in Chrono Forms is indicating that this doesn't work.

I just hit an bad luck to give a field name that was used somewhere else.

I'm not sure I'm going to push it further. I have many other projects to do, but I wish I could find if some other field name are restricted for any reason.

Have a good day.

Hugues Lamy - http://m2i3.com
Max_admin 15 May, 2009
Hi Hugues,

Yes, nothing in Chronoforms should block this but the session_id variable may be easily used anywhere else! although I'm not sure where too! :?

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 15 May, 2009
Hi Hugues,

Tough to tell without a little experiment. A Google search on site:api.joomla.org session_id will give you some good clues though.

Bob
This topic is locked and no more replies can be posted.