New Zenner
- Join Date:
- Jul 2009
- Posts:
- 2
- Plugin Contributions:
- 0
Post #1 by orzel
I have zencart. 1.3.8 running on Linux with php in cgi.
How do I access the zen cart $_SESSION['cart'] from pages that are not within my store?
I have my zencart at:
mydomain.com/store
I have another application at:
mydomain.com/myapp
Within myapp I have an AJAX call to a php file that tries to read the cart parameters $_SESSION['cart']->show_total() (as an example)
One thing I noticed is that the session id is lost outside of mydomain/store. I thought a session id was good across the whole domain since init_sessions.php has:
session_set_cookie_params(0, '/', (zen_not_null($current_domain) ? $current_domain : ''));
From mydomain/myapp I have an ajax call to ajax.php file I tried:
<?php require('../includes/application_top.php'); echo $_SESSION['cart']->show_total(); ?>I tried this file in a few locations within the zencart directory (store/pub) and within myapp directory and changed the location of application_top.php and it didn't echo anything back through my ajax call.
I would think there would be a simple way to access the cart info from outside of the zencart directory from within the same domain?
Thanks,
Mark