[TYPO3] cookies

Dmitry Dulepov typo3 at accio.lv
Thu Apr 27 11:54:39 CEST 2006


Hi!

Andrea Giorgini wrote:
> 1) can I do anything with TS or I just need PHP;

TS+PHP

TS is:

==================
page.10 = TEXT
page.10.data = global:_COOKIE|username
page.10.wrap = Hello, |

includeLibs.setNameCookie = fileadmin/user_setnamecookie.php
page.1000 = USER
page.1000.userFunc = user_setNameCookie

==================

PHP is in fileadmin/user_setnamecookie.php, something like:

<?
function user_setNameCookie() {
	global	$TSFE;

	if ($TSFE->loginUser) {
		setcookie('username', $TSFE->fe_user->name,
			time() + 365*24*60*60, '/');
	}
	return '';
}
?>


> 2) do I have to write the whole code (no problem, just a matter of
> *knowing* it - storing and restoring data) or I can use some predefined
> typo3 functions.

See above :)

Dmitry.
-- 
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)



More information about the TYPO3-english mailing list