$smarty.session.id

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
spinfold
Forum Members
Forum Members
Posts: 44
Joined: Fri Nov 12, 2010 10:15 am

$smarty.session.id

Post 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?
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: $smarty.session.id

Post 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
Post Reply

Return to “CMSMS Core”