Re: Smarty and Sessions

From: Date: Tue, 05 Jul 2005 01:06:33 +0000
Subject: Re: Smarty and Sessions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12775@lists.php.net to get a copy of this message
* "Jim MacDiarmid" <jim.macdiarmid@comcast.net>: > I'm very new to Smarty so I'm hoping someone can help me. > > Can someone explain how the $smarty.session.user variable is set? Is this > something native to smarty or something unquie to the sample code I have? Smarty loads most of the superglobal variables (_GET, _POST, SESSION, etc.) as keys of the $smarty variable. For $smarty.session to be set, you'll need to call session_start() in the script that creates the Smarty object. To make sure that $smarty.session.user is set, you'll also need to set $_SESSION['user'] in that same script, or in a previous script available in the same session. -- Matthew Weier O'Phinney Zend Certified Engineer http://weierophinney.net/matthew/

« previous php.smarty.general (#12775) next »