[TYPO3-dev] Xajax Store Session Data

Sebastiaan van Parijs sebastiaan at framed.nl
Fri Mar 20 12:33:21 CET 2009


Hey guys,

In my Plugin i'm trying to combine Xajax and sessions. And so far i 
can't seem to get it to work, so here is my code:

##CODE##
function processFormData( $data )	{

$sessionData = $GLOBALS['TSFE']->fe_user->getKey( "ses","Data" );

$table = key( $sessionData['config.']['storedData.'] );

// Check so Allready StoredData wont be lost...
if ( is_array( $sessionData['config.']['storedData.'][ $table ] )) {

$sessionData['config.']['storedData.'][ $table ] = array_merge( 
$sessionData['config.']['storedData.'][ $table ], $data['FE'][ $table ] );
} else {
$sessionData['config.']['storedData.'][ $table ] = $data['FE'][ $table ];			
}

$GLOBALS['TSFE']->fe_user->setKey( "ses","Data", $sessionData );

$session = $GLOBALS['TSFE']->fe_user->getKey( "ses","Data" );

$content = t3lib_div::view_array( $session );

// Instantiate the tx_xajax_response object
$objResponse = new tx_xajax_response();
// Add the content to or result box
// Result = Debug Div
$objResponse->addAssign( 'result', 'innerHTML', $content );
//return the XML response
return $objResponse->getXML();
}
##CODE##

As the $content shows the data has been stored in the session, but for
some reason, when i hit refresh and print_r my session it doesn't show.
Apparently im doing something wrong any idea's?

Thnx,
Sebastiaan




More information about the TYPO3-dev mailing list