[Typo3] Frontend Modules Sessions
Nick Weisser
typo3 at openstream.ch
Mon May 9 09:54:41 CEST 2005
Hi there,
I found a nice description about sessions in regard to extension
programming in the Typo3 Wiki:
---------------------------------------------------------------------
In Frontendmodules Sessions are called slightly differently by using:
$my_vars = $GLOBALS["TSFE"]->fe_user->getKey('ses','tx_myextension');
you then will add your own values the same way:
$my_vars['somevalue'] = "Hello World";
Again, Don't forget to save the data to the session in the end:
$GLOBALS["TSFE"]->fe_user->setKey('ses','tx_myextension',$my_vars);
---------------------------------------------------------------------
But this does not seem to work in my extension.
My Code looks like this
---------------------------------------------------------------------
$labelinfo = $GLOBALS["TSFE"]->fe_user->getKey('ses','tx_myextension');
$labelinfo[] = $label_text[0];
$labelinfo[] = $label_text[1];
$labelinfo[] = $label_text[2];
$labelinfo[] = $label_text[3];
$GLOBALS["TSFE"]->fe_user->setKey('ses', 'tx_myextension', $labelinfo);
---------------------------------------------------------------------
Can I keep the 'ses' value as it is? Does tx_myextension refer to the
extension key, to the foldername of my extension or to the filename of
my main extension class?
Your input would really be appreciated ;-)
Thanks,
Nick
More information about the TYPO3-english
mailing list