Forum / Development Forum / Support request / _SESSION and _REQUEST variables 


+   Reply to Thread

Just a quick question... can somebody show me exactly what I'd need to put into a template in order to display a SESSION or REQUEST variable?

I've tried {$_SESSION.variable} but this thows an error.

Thanks,
Mat
http://www.raintpl.com/Documentation/Documentation-for-web-designers/RainTPL-Tags/__variable_/

{$GLOBALS._SESSION.variable}

Best
Hi.

I've tried that, but it also throws an error:
RainTPL Sandbox Error in template ...

I'm using RainTPL version 2.6.4 if that helps?

Regards,
Mat
Update...

Just tried again using $GLOBALS._SESSION.variable and $GLOBALS._REQUEST.variable -- it fails with _SESSION variables, but works with _REQUEST

The _SESSION is definitely staretd before initializing RainTPL.

I can probably do what I need using _REQUEST, but it's a bit strange.
I'm continuing to try to do things by using {GLOBALS.etc} in my templates. It's proving to be very useful (despite _SESSION variables not working).

Can you please tell me if it's possible to access a value from an array contained in an object?

I figured it would be something like: {$GLOBALS.object->array.value} but that's not right. However, it does work for something like {$GLOBALS.object->variable}

Any tips?
Hi Mat,
sorry for your problem and for late answer, we're focusing on the RainCMS right now (alpha on github).

In order to use the session you've to remove _SESSION from the sandbox, or it will throw a sandbox error!

For the uses of . (dot) and -> (arrow) operators, I suggest to try the latest version there are a few changes and it should work.

+   Reply to Thread