Share » Forums » Developer » please, very urgent:how to store...

please, very urgent:how to store session variables?

please, very urgent:how to store session variables?

Tuesday 09 March 2004 2:30:16 am - 3 replies

Author Message

Bård Farstad

Tuesday 09 March 2004 2:48:57 am

You can set a session variable by doing:
$http =& eZHTTPTool::instance();
$http->setSessionVariable( "MyVar", "MyValue" );

You can read the session variable by doing:
if ( $http->hasSessionVariable( "MyVar" ) )
$myVar = $http->sessionVariable( "MyVar" );

This is PHP code, you cannot set session variables in templates.

--bård

Documentation: http://ez.no/doc

Alessandro Cipriani

Tuesday 09 March 2004 2:53:04 am

thanx bard?
just other 2 questions: where should i place this code? into the index.php file?
there is the possibility to retrieve a timestamp (or session id) into this code and store it in a session variable?

best regards
alessandro

Alessandro Cipriani

Tuesday 09 March 2004 6:24:09 am

bard
i can't get the session variable into the template since the language is php right?
so, can you explain me where should i write the code that retrieves the value and how to pass it to the template?

best regards
alessandro

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu