losing session data - Joomla! Forum - community, help and support
i have created simple plugin changed {wishlist} button stores session of current article title. have module displays sessions shopping cart.
i got 2 problems, first problem (which important) module displays session when navigate different page, example frontpage user-login. lose data session , module becomes empty.
how can store data losing when user closes web browser? code pasted below:
and lastly how can make session array display more 1 item? it:
thanks in advanced
i got 2 problems, first problem (which important) module displays session when navigate different page, example frontpage user-login. lose data session , module becomes empty.
how can store data losing when user closes web browser? code pasted below:
code: select all
<?php
//no direct access
defined('_jexec') or die('restricted access');
//create session
session_start();
$product = mysql_real_escape_string($_post['product']);
$session = jsession::getinstance('product',array($product));
$session->set('product', $product);
echo "<h2>". $session->get('product') ."</h2>";
and lastly how can make session array display more 1 item? it:
code: select all
$session = jsession::getinstance('product',array($product));
thanks in advanced
aaron harding wrote:i have created simple plugin changed {wishlist} button stores session of current article title. have module displays sessions shopping cart.
i got 2 problems, first problem (which important) module displays session when navigate different page, example frontpage user-login. lose data session , module becomes empty.
how can store data losing when user closes web browser? code pasted below:code: select all
<?php
//no direct access
defined('_jexec') or die('restricted access');
//create session
session_start();
$product = mysql_real_escape_string($_post['product']);
$session = jsession::getinstance('product',array($product));
$session->set('product', $product);
echo "<h2>". $session->get('product') ."</h2>";
and lastly how can make session array display more 1 item? it:code: select all
$session = jsession::getinstance('product',array($product));
thanks in advanced
calling session_start messing joomla's session handling.
probably easier do:
$app = &jfactory::getapplication();
$product = $app->getuserstatefromrequest('mypluginname.product', 'product', 'default value return if no session variable or request variable found');
ian
Comments
Post a Comment