$smarty.session.id

From: Date: Tue, 24 Dec 2002 15:27:02 +0000
Subject: $smarty.session.id
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6933@lists.php.net to get a copy of this message
Hello all! I'd tried to use $smarty.session.id as it was described in the Smarty manual, but it wasn't work. It didn't print out session ID. I explored Smarty_compiler.class.php and found that $smarty.session array is PHP $_SESSION array. But it DOESN'T contain the session id data! (try to make print_r($_SESSION)) PHP's manual tells us that " .. SID is only defined if the client didn't send the right cookie." So, decide to make a little patch to the Smarty_compiler.class.php and make $smarty.session_id variable (much like $smarty.now) The code I've insert in _compile_smarty_ref function is case 'session_id': $compiled_ref = 'session_id()'; if (count($indexes) > 1) { $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference'); } break; It's simple, but it would be usefull for somebody (i try to find an answer in mailing list, docs, etc for several hours). -- Best regards, Alexander mailto:shura@ukrsat.com

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