Session problems (Virtuemart)

Started by jocke4u, May 30, 2006, 03:59:01 PM

Previous topic - Next topic

jocke4u

It seems to be a lot of problems with the session management when you have Virtuemart and SMF installed (and the SMF bridge of course).

One of the problem I have right now is the SMF login module (mod_smf_login.php) complaining about undefined PHPSESSID:

Notice: Undefined index: PHPSESSID in /srv/www/virtual/test.jarkeborn.se/Anybody/__TEST__/Joomla_1.0.8_eCom/modules/mod_smf_login.php on line 48

Occurs if I have new browser window but if I refresh the window the error goes away.

Any idea?
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

iqapps

Hi

Version of VM and bridge please?

jocke4u

Hi there,

See my signature  ;D

PS. I visited your site yesterday, really impressing work you have done. DS

BR
Joacim, Sweden
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

iqapps

#3
Hi

I know :D
Have you tryed this i have simlar problem when I upgrade to 1.0.5
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=18121.msg42160#msg42160
Regards
IQAPPS

jocke4u

Yes, I have applied that VM fix since without it I get a complete white screen.
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

Orstio

Comment out this part of mod_smf_login.php:

//VirtueMart compatibility
if (file_exists($mosConfig_absolute_path . '/components/com_virtuemart/virtuemart.php')){
$sc = $_COOKIE['PHPSESSID'];
$result = mysql_query("SELECT data FROM {$db_prefix}sessions WHERE session_id = '".$sc."'");
list($sqldata) = mysql_fetch_row($result);
if (strpos($sqldata,'rand_code'))
$sc = substr($sqldata, strpos($sqldata,'rand_code')+16,32);
if ($sc)
$context['session_id'] = $sc;
}

jocke4u

This code doesn't provide handling for session compability between Virtuemart and SMF?
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

Orstio

In most cases.  There are a few exceptions, apparently.  I'm going to make it optional in future bridges, so it can be set in the config to avoid the discrepencies, and nobody ends up falling between the cracks.

For your site, it seems to be causing problems, not fixing them.

jocke4u

Hi,

I am still having problems with my setup. I am working on integration of SMF 1.1 RC2 forum to my Joomla 1.0.8/VM 1.0.5 installation. Yes, I have heard/experienced that this combination is really pain but since SMF is such good forum I think it's worth trying a bit. Using the SMF Bridge 1.1.4.

I have the forum working quite well but VM doesn't feel that good and it's all about the session handling.

Now I have problems during the checkout process and on the last page (confirm order button) I get:
Notice: Undefined index: coupon_discount in /srv/www/virtual/DOMAIN/Joomla_1.0.8_eCom/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1283

and the line is telling:
$discounted_total = $d['order_subtotal_withtax'] - $_SESSION['coupon_discount'] - $d['payment_discount'];

Anyone having a similar working setup and/or have ideas how to solve this?
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

jocke4u

It seems to be something with PHP versions (or maybe PHP settings)
I protected it with:

$me_coupon_discount = (isset($_SESSION['coupon_discount']) ? floatval($_SESSION['coupon_discount']) : 0.00);
$me_payment_discount = (isset($_SESSION['payment_discount']) ? floatval($_SESSION['payment_discount']) : 0.00);

$discounted_total = $d['order_subtotal_withtax'] - $me_coupon_discount - $me_payment_discount;


I think Joomla 1.0.8 + Virtuemart 1.0.5 + SMF 1.1RC2 is working quite fine right now. There is one problem left as described in: http://www.simplemachines.org/community/index.php?topic=90472.msg594762#msg594762
Regards
Joacim, Sweden
[ Joomla 1.0.11 -- Virtuemart 1.0.6 -- SMF 1.1 RC3 -- SMF Bridge 1.1.6 ]

Advertisement: