[Typo3-dev] bug with session on header redirect

Andreas Otto ao-lists at php4win.de
Fri Jun 3 11:10:45 CEST 2005


On Freitag, 3. Juni 2005 09:55, Stefan Beylen wrote in typo3.dev:

> unset ($sessionvar);
> $GLOBALS["TSFE"]->fe_user->setKey("ses","sessionvar",$sessionvar);

Add the next line here:
$GLOBALS['TSFE']->fe_user->storeSessionData();

> header('Location: '.t3lib_div::locationHeaderUrl('redirect.html');

You need to "force" storeSessionData() if you leave your script with
header(Location: ...).

Normally storeSessionData() will be called in line 461 in index_ts.php
in TYPO3 3.8.0.

As an alternative you could set:
$GLOBALS['TSFE']->jumpurl = http://www.example.com/redirect.html

And then get rid of header(Location: ...)


Cheers,
Andreas

-- 
Don't comment bad code - rewrite it.
            - The Elements of Programming Style (Kernighan & Plaugher)





More information about the TYPO3-dev mailing list