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

Collapse
Posted by Benjamin Brink on
Sorry, Iuri, I just re-read your question.

The relevant procs are:
ec_get_user_session_id
ec_create_new_session_if_necessary

If the session_id doesn't already exist, it is supposed to create one.

For some reason, the supplied session_id is not matching in the system.

Maybe there is a way to add a filter for cases referred by the first domain, and automatically force a new ec_session_id?

best wishes,
Ben

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.