Page 1 of 1

$smarty.session.id

Posted: Fri Apr 08, 2011 7:47 am
by spinfold
I am trying to use {$smarty.session.id} (where "id" is the name of the PHP session set in a PHP file outside of CMSMS templates) in a CMSMS template but every time it displays absolutely nothing. No error even!

The method is discussed at http://www.smarty.net/docsv2/en/languag ... smarty.tpl (Example 4.7, second one from bottom)

Is this possible? Do I need to add something else:

Code:

PHP (outside of CMSMS)

Code: Select all

$_SESSION['loggedin']="ok";
Smarty (in a CMSMS template)

Code: Select all

{$smarty.session.loggedin}
If I set up the equivalent PHP code, the session displays as expected, so there is no problem with the actual setting of the session variable.

Any thoughts?

Re: $smarty.session.id

Posted: Sat Apr 16, 2011 11:20 pm
by spcherub
Try {$smarty.session|@print_r} in a test page. This should display all your session variables and you may be able to glean the exact name/syntax for the variable that you are looking for.

Hope that helps.
-S