Forum OpenACS Development: Re: Ecommerce pkg: an alternative to session

Collapse
Posted by Iuri Sampaio on
Thanks Ben, ad_procs ec_get_user_session_id and ec_create_new_session_if_necessary are within the script already. The file's /packages/ecommerce/www/shopping-cart.tcl

The feature "add-product-to-cart" works fine when I'm in the same domain.

The feature doesn't work because product's catalog is displayed on WWW while ecommerce isn't in the same domain. ( i.e. https://www.evex.co/welcome/search_items and https://evex.co/ecommerce
As expected, they won't share session, and shopping cart feature needs it in order to work well. Is that correct?

So, I'm looking for another way to make it work, without rewriting the whole CSS, HTML and JS, to display the catalog inside OACS.

1) I've tried, on NGINX, to proxy all URL requests "~/ecommerce/*" requests to www. SSL's wildcard and as both pages are under the same umbrella, i.e. the same domain and session, now they share ec_user_session_id

It worked at some point but it's definitely not a solution, and it can break acs-authentication and other pieces.

2) I also tried to add an OACS page in the middle to force user login and ec_user_session once more, but it didn't work out.

3) I wonder if a RestFul API would be a good solution. It'd be much more work. That's for sure.