Sunday, October 23, 2011

Joomla 1.5 - SESSIONS

---
SESSIONS in Joomla - JSession

** nothing in it by default **

$session =& JFactory::getSession();
echo "<pre><b>Joomla session var</b><br>< br>";print_r($user);echo "</pre><br><br>";

--

http://docs.joomla.org/JFactory/getSession

>> The following code gets the current session then sets the value of the session variable 'myvar' to 'helloworld'.

$session =& JFactory::getSession();
$session->set( 'myvar', 'helloworld' );

>> The session variable can be retrieved later in a similar way.

$session =& JFactory::getSession();
echo 'Session variable myvar has value: ' . $session->get( 'myvar', 'empty' );


(more options, using their classes)
http://docs.joomla.org/JSession/1.5

No comments:

Post a Comment