Why am I intermittently losing Joomla2.5 session data? - Joomla! Forum - community, help and support


question
why intermittently losing joomla session data?

details

i'm using script external joomla2.5.7 get/set joomla variables multiple times. script makes asynchronous ajax call record whenever specific event occurs in script. each update, session information retrieved array. array updated new information , set again session data.
the problem i'm having @ completion of script of data intermittently goes missing. seems happen more when user logged in.

script1

code: select all

$.ajax(
            {   cache:false,
                url: 'script2.php',
                data: { 'change': change},             
                datatype: 'json',               
                success: function(data)
                {
                    //do something
                }
            });


script 2

code: select all

<?php
// joomla! framework
define( '_jexec', 1 );
define( '_valid_mos', 1 );
define( 'jpath_base', realpath(dirname(__file__).'/../../../..' ));
define( 'ds', directory_separator );
require_once ( jpath_base .ds.'includes'.ds.'defines.php' );
require_once ( jpath_base .ds.'includes'.ds.'framework.php' );

$app = &jfactory::getapplication('site');
$app->initialise();
$session = jfactory::getsession();
$jquizstart = date( 'y-m-d h:i:s', time() );    //<<-- time of access       

    $jqid = $session->get('jqid');                //<<-- array session
    if (isset($_get['change']))
    {
        $qnumber=$_get['change'];   
        $firephp->log($qnumber, 'qnumber');
        $jqid[$qnumber][3]=$jquizstart;     //<<--  add time of access array
        $firephp->log($jqid[$qnumber][3], '$jqid[$qnumber][3]');
        $session->set('jqid', $jqid);       //<<-- store array in joomla updated data
    }
    else
    {
        $firephp->log('change not set');
    }

?>


other details

i’m using joomla 2.5.7
php 5.4.3 (also tested php 5.3.10)
apache 2.2.22
server on localhost

please note i've posted question bounty on stackoverflow.

if there alternative using joomla session variables i'd love hear it.





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

PProHeadless.exe has stopped working error when opening projects in Adobe Media Encoder CS6

Preconditions Failed. - Joomla! Forum - community, help and support