Forum OpenACS Q&A: Ecommerce 4.6.3+, new users lose basket contents on sign-up

What should be done so that basket contents are remembered?

I have read this[1] thread and bug[2] report regarding this problem for openacs5. However, I do not yet possess the mental holligraphic terminology and implicit framework of openacs to understand how to apply a fix to openacs4.6.3, which apparently should not have this problem to begin with.

The affected install is a version 4.6.4 from cvs.

1. https://openacs.org/forums/message-view?message_id=68598

2. https://openacs.org/bugtracker/openacs/com/ecommerce/bug?bug%5fnumber=1072

Torben,

AFAIK ecommerce still uses its own login pages. The switch from http to https doesn't really matter in this case. What IS important is that ecommerce issues its own session ID. The ID is issued as soon as you visit ecommerce pages.

Pruchases are placed in a shopping card linked to this ecommerce session ID. Losing the card's content is the result of losing the ID during login. Trace what happens when you login. Which set of login pages are used? The ecommerce pages or the subsite pages? In OpenACS 4.6.3 the subsite pages would clobber the ecommerce session ID. I belief that the ecommerce session ID is called ec_session_id.

Good luck.

/Bart

I noticed some issues with cookie handling that I fixed in one of my installations because I didn't like the way session cookies were set.

A possibility is that the person surfed to www.domain.com, and then was logged in to domain.com.  Since OpenACS 5 doesn't set the cookie domain, I would assume that OpenACS 4.6 doesn't either.

Alternatively, if you've done something like https://secure.domain.com and they came from http://www.domain.com, you would not be able to read the cookie that was set.

Setting the cookie domain will break using subdomains if you want to maintain separate logins, i.e. http://sitea.domain.com and http://siteb.domain.com would not work properly.  But, if all of the hostnames you have serve the same content, you could just set the domain parameter in the cookie, and access http://domain.com, http://www.domain.com, https://secure.domain.com without having to log in each time.

Thanks, Bart and Chris.

I made a step by step log of cookies, urls and log notices through this process..

rp had a problem with undefined @title@ in /ecommerce/register/user-new-2.adp

I removed @title@ to temporarily bypass that problem. The rp then had a problem with @site_link@ on same page, so I removed it, too. Now..

Given:

a user connecting via http and domain (no www.*) adds product 3560, proceeds to checkout, system redirects to https, user registers as user35.

problem:

no change in symptoms from user perspective. (shopping basket empty after login).

Are the below session cookie expirations from error.log normal?

# error.log (less clearly arbitrary sched proc notices)

[06/Feb/2004:20:48:16][44463.145141760][-conn4-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/s\hopping-cart?product%5fid=3560
[06/Feb/2004:20:48:17][44463.143538176][-conn0-] Notice: LARS: counter = 0 ; this_row? 0 ; next_row? 0
[06/Feb/2004:20:48:29][44463.145141760][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/\register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=\277
[06/Feb/2004:20:48:30][44463.143538176][-conn0-] Notice: Security: 1076100510 sec_generate_session_id_cookie\ setting 740006, 3675.
[06/Feb/2004:20:48:56][44463.145141760][-conn4-] Notice: user_session_id cookie expired
[06/Feb/2004:20:48:56][44463.145141760][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/\register/user-new?email=user35%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2eco\m%3a8443%2fecommerce%2fcheckout
NOTICE:  identifier "acs_object__initialize_attributes" will be truncated to "acs_object__initialize_attribu\t"
[06/Feb/2004:20:49:24][44463.190326784][-sched:8-] Notice: Running scheduled proc acs_mail_lite::sweeper...
[06/Feb/2004:20:49:24][44463.190326784][-sched:8-] Notice: Done running scheduled proc acs_mail_lite::sweepe\r.
NOTICE:  Adding missing FROM-clause entry for table "acs_object_id_seq"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke\"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke\"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio\"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio\"
[06/Feb/2004:20:49:24][44463.145141760][-conn4-] Notice: Security: 1076100564 sec_generate_session_id_cookie\ setting 750007, 3677.
[06/Feb/2004:20:49:24][44463.145141760][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/\checkout
[06/Feb/2004:20:49:25][44463.143538176][-conn0-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/\checkout?usca%5fp=t
[06/Feb/2004:20:49:26][44463.143699968][-conn1-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/\index
[06/Feb/2004:20:49:27][44463.174976000][-sched:23-] Notice: Running scheduled proc notification::sweep::swee\p_notifications...
[06/Feb/2004:20:49:27][44463.174976000][-sched:23-] Notice: Done running scheduled proc notification::sweep:\:sweep_notifications.
[06/Feb/2004:20:49:42][44463.143699968][-conn1-] Notice: LARS: counter = 0 ; this_row? 0 ; next_row? 0

What else should I check? Suggestions (on what to try next etc), hints much appreciated,

Torben

I'll post a complete timeline of cookie and related log activity later this evening/early morning..

User perspective:

User gets to: http://dekka.com
# no cookies

http://dekka.com:8000/
# cookie: ad_session_id
#   content: 800004%2c0%20%7b338%201076140096%20BF3FBA239412D27D173D25D7670E4B3FB9949A75%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/06/04 23:50:06
#   policy: no policy..

# click link to dekka.com:8000/ecommerce/
http://dekka.com:8000/ecommerce/?usca%5fp=t
# cookie: ad_session_id
#   content: 800004%2c0%20%7b338%201076140096%20BF3FBA239412D27D173D25D7670E4B3FB9949A75%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/06/04 23:50:06
#   policy: no policy..
# cookie: user_session_id
#   content: 281
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

# click link to view category
http://dekka.com:8000/ecommerce/category-browse?category_id=1
# cookie: ad_session_id
#   content: 800004%2c0%20%7b342%201076141032%20E53A12ADF0D0272F7274D8482892D79F8451BAAB%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:05:50
#   policy: no policy..
# cookie: user_session_id
#   content: 281
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

# click on item link: http://dekka.com:8000/ecommerce/product?product_id=3560
http://dekka.com:8000/ecommerce/product?product_id=3560
# cookie: ad_session_id
#   content: 800004%2c0%20%7b342%201076141032%20E53A12ADF0D0272F7274D8482892D79F8451BAAB%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:05:50
#   policy: no policy..
# cookie: user_session_id
#   content: 281
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

# click "add to cart" button
http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560
# cookie: ad_session_id
#   content: 800004%2c0%20%7b342%201076141032%20E53A12ADF0D0272F7274D8482892D79F8451BAAB%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:05:50
#   policy: no policy..
# cookie: user_session_id
#   content: 281
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

# click "Proceed to checkout" button
https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281
# cookie: ad_session_id
#   content: 800004%2c0%20%7b401%201076141378%2070A9AAF4657275EEE47FF067523122903462491B%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:11:28
#   policy: no policy..
# cookie: user_session_id
#   content: 281
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

#entered new user info (email address, password), clicked "submit"
https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
# cookie: ad_session_id
#   content: 800004%2c0%20%7b401%201076141378%2070A9AAF4657275EEE47FF067523122903462491B%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:11:28
#   policy: no policy..
# cookie: user_session_id does not exist

# entered user info (verified password, entered first_names, last_name, cusotmized question/answer), clicked "register" button
https://dekka.com:8443/ecommerce/index
# cookie: ad_session_id
#   content: F4657275EEE47FF067523122903462491B%7d
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: 02/07/04 00:11:28
#   policy: no policy..
# cookie: user_session_id
#   content: 282
#   host: dekka.com
#   path: /
#   server secure: no
#   expires: at end of session
#   policy: no policy..

service0.log perspective:

24.20.69.247 - - [07/Feb/2004:07:28:16 +0000] "GET / HTTP/1.1" 200 15768 "http://www.dekka.com/" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:28:20 +0000] "GET /lists.css HTTP/1.1" 304 0 "http://dekka.com:8000/" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:31:20 +0000] "GET /ecommerce/ HTTP/1.1" 302 318 "http://dekka.com:8000/" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:31:21 +0000] "GET /ecommerce/?usca%5fp=t HTTP/1.1" 200 18433 "http://dekka.com:8000/" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:31:21 +0000] "GET /lists.css HTTP/1.1" 304 0 "http://dekka.com:8000/ecommerce/?usca%5fp=t" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:44:00 +0000] "GET /ecommerce/category-browse?category_id=1 HTTP/1.1" 200 16234 "http://dekka.com:8000/ecommerce/?usca%5fp=t" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:44:01 +0000] "GET /lists.css HTTP/1.1" 304 0 "http://dekka.com:8000/ecommerce/category-browse?category_id=1" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:46:38 +0000] "GET /ecommerce/product?product_id=3560 HTTP/1.1" 200 16849 "http://dekka.com:8000/ecommerce/category-browse?category_id=1" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:46:39 +0000] "GET /lists.css HTTP/1.1" 304 0 "http://dekka.com:8000/ecommerce/product?product_id=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:48:10 +0000] "POST /ecommerce/shopping-cart-add HTTP/1.1" 302 338 "http://dekka.com:8000/ecommerce/product?product_id=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:48:11 +0000] "GET /ecommerce/shopping-cart?product%5fid=3560 HTTP/1.1" 200 16466 "http://dekka.com:8000/ecommerce/product?product_id=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:48:11 +0000] "GET /lists.css HTTP/1.1" 304 0 "http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:49:38 +0000] "POST /ecommerce/checkout HTTP/1.1" 302 419 "http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:49:39 +0000] "GET /ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281 HTTP/1.1" 200 4196 "http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:49:39 +0000] "GET /lists.css HTTP/1.1" 200 5932 "https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:52:06 +0000] "POST /ecommerce/register/user-login HTTP/1.1" 302 448 "https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:52:07 +0000] "GET /ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout HTTP/1.1" 200 3666 "https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:52:08 +0000] "GET /lists.css HTTP/1.1" 304 0 "https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:56:08 +0000] "POST /ecommerce/register/user-new-2 HTTP/1.1" 200 317 "https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:56:09 +0000] "GET /ecommerce/checkout HTTP/1.1" 302 328 "https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:56:10 +0000] "GET /ecommerce/checkout?usca%5fp=t HTTP/1.1" 302 314 "https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:56:11 +0000] "GET /ecommerce/index HTTP/1.1" 200 18571 "https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"
24.20.69.247 - - [07/Feb/2004:07:56:12 +0000] "GET /lists.css HTTP/1.1" 304 0 "https://dekka.com:8443/ecommerce/index" "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030727"

serivce0-error.log perspective:

[07/Feb/2004:07:28:16][45130.139844608][-conn2-] Notice: Security: 1076138896 sec_generate_session_id_cookie setting 800004, 0.
[07/Feb/2004:07:31:20][45130.143695872][-conn1-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/?usca%5fp=t
[07/Feb/2004:07:43:52][45130.143695872][-conn1-] Notice: Security: 1076139832 sec_generate_session_id_cookie setting 800004, 0.
[07/Feb/2004:07:48:10][45130.145106944][-conn3-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560
[07/Feb/2004:07:48:10][45130.139866112][-conn4-] Notice: LARS: counter = 0 ; this_row? 0 ; next_row? 0
[07/Feb/2004:07:49:38][45130.145106944][-conn3-] Notice: Security: 1076140178 sec_generate_session_id_cookie setting 800004, 0.
[07/Feb/2004:07:49:38][45130.145106944][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=281
[07/Feb/2004:07:52:05][45130.145106944][-conn3-] Notice: user_session_id cookie expired
[07/Feb/2004:07:52:06][45130.145106944][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
[07/Feb/2004:07:56:06][45130.145106944][-conn3-] Notice: Security: 1076140566 sec_generate_session_id_cookie setting 800004, 0.
NOTICE:  identifier "acs_object__initialize_attributes" will be truncated to "acs_object__initialize_attribut"
NOTICE:  Adding missing FROM-clause entry for table "acs_object_id_seq"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio"
[07/Feb/2004:07:56:08][45130.145106944][-conn3-] Notice: Security: 1076140568 sec_generate_session_id_cookie setting 800004, 3679.
[07/Feb/2004:07:56:08][45130.145106944][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout
[07/Feb/2004:07:56:09][45130.139866112][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout?usca%5fp=t
[07/Feb/2004:07:56:10][45130.143695872][-conn1-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/index
user_session_id is gone after /ecommerce/register/user-new is served. Yet, the previous page ( /ecommerce/register/index ) apparently passes user_session_id to user-new since "&user_session_id=281" is in the url.

/ecommerce/register/user-new seems innocuous enough..

This cookie problem cooresponds to log time: 07/Feb/2004:07:52:07

..which cooresponds to this activity in the error log:

[07/Feb/2004:07:52:05][45130.145106944][-conn3-] Notice: user_session_id cookie expired
[07/Feb/2004:07:52:06][45130.145106944][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/user-new?email=user36%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
[07/Feb/2004:07:56:06][45130.145106944][-conn3-] Notice: Security: 1076140566 sec_generate_session_id_cookie setting 800004, 0.
NOTICE:  identifier "acs_object__initialize_attributes" will be truncated to "acs_object__initialize_attribut"
NOTICE:  Adding missing FROM-clause entry for table "acs_object_id_seq"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke"
NOTICE:  identifier "acs_object_type_get_tree_sortkey" will be truncated to "acs_object_type_get_tree_sortke"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio"
NOTICE:  identifier "acs_permission__grant_permission" will be truncated to "acs_permission__grant_permissio"

user_session_id is supposed to expire at end of session.. hmm..

Okay, tracking this behavior, it appears that:

1. ecommerce/register/index redirects to ecommerce/register/user-new via user-login.

2. user-login passes user_session_id to user-new.

3. user-new does not collect user_session_id (drops it) and subsequently the contents of anything already in the new user's shopping basket.

4. user-new-2 also does not collect or pass user_session_id. Upon post, user is redirected to an empty shopping cart and issued a new user_session_id.

oops. Forgot to ask..

Is this an accurate conclusion?

apparently not.

Bartt (in irc) gave me this fix:

commenting out ec_user_session_logout from ecommerce/register/user-login.tcl

posting bug/fix

Thanks, Bart!

The problem persists..

The Bartt's above suggestion is part of the solution. user_id's are no longer forced to 0, and thus retain shopping cart contents if a user_id other than 0 exists, such as from a previous session.

However, new-users start with user_id = 0.

My earlier tests should have caught this, but I was not deleting cookies. Due to a small fixed screen and an over-sized cookie-manager window in browser, I was inadvertently clicking "cancel" instead of "ok" button! =/

New users start with user_id of 0. As soon as new-user gets a non-zero user_id, a new user_session_id is granted, and the contents are lost.

This following example shows the progression of a user who puts something in the shopping-cart, then tries to checkout. (abridged error log, ns_log notices added)

file references have base pathname service0/packages/ecommerce/www/
..
[19/Apr/2004:08:14:00][58837.146861056][-conn1-] Notice: Security: 1082362440 sec_generate_session_id_cookie setting 1150026, 0.
[19/Apr/2004:08:14:04][58837.146861056][-conn1-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/?usca%5fp=t
..
[19/Apr/2004:08:14:59][58837.146377728][-conn4-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=1231
[19/Apr/2004:08:15:00][58837.144527360][-conn2-] Notice: shopping-cart.tcl line40 initial user_id: 0
[19/Apr/2004:08:15:00][58837.144527360][-conn2-] Notice: shopping-cart.tcl line48 initial from ad_conn user_id: 0
[19/Apr/2004:08:15:00][58837.144527360][-conn2-] Notice: shopping-cart.tcl line50 user_session_id: 399
[19/Apr/2004:08:15:00][58837.144527360][-conn2-] Notice: shopping-cart.tcl line53 user_session_id: 399
[19/Apr/2004:08:15:00][58837.144527360][-conn2-] Notice: LARS: counter = 0 ; this_row? 0 ;next_row? 0
[19/Apr/2004:08:15:06][58837.144527360][-conn2-] Notice: checkout.tcl line15 initial from ad_conn user_id: 0
[19/Apr/2004:08:15:06][58837.144527360][-conn2-] Notice: checkout.tcl line17 initial from ec_get_user_session_id: 399
[19/Apr/2004:08:15:06][58837.144527360][-conn2-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fc
heckout&http_id=0&user_session_id=399
[19/Apr/2004:08:15:06][58837.146861056][-conn1-] Notice: Security: 1082362506 sec_generate_session_id_cookie setting 1150027, 0.
[19/Apr/2004:08:15:06][58837.146861056][-conn1-] Notice: register/index.tcl line23 user_session_id: 399
..
[19/Apr/2004:08:15:25][58837.146861056][-conn1-] Notice: user-login.tcl line27 user_session_id: 399
..
[19/Apr/2004:08:15:26][58837.146861056][-conn1-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/user-new?email=user84%40dekka%2enet&persistent%5fcookie%5fp=1&ret
urn%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
..
[19/Apr/2004:08:15:58][58837.146375680][-conn3-] Notice: Security: 1082362558 sec_generate_session_id_cookie setting 1150027, 6823.
[19/Apr/2004:08:15:58][58837.146375680][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout
[19/Apr/2004:08:15:59][58837.140103680][-conn0-] Notice: checkout.tcl line15 initial from ad_conn user_id: 6823
[19/Apr/2004:08:15:59][58837.140103680][-conn0-] Notice: checkout.tcl line17 initial from ec_get_user_session_id: 0
[19/Apr/2004:08:15:59][58837.140103680][-conn0-] Notice: user_id from ad_verify_and_get_user_id: 6823
[19/Apr/2004:08:15:59][58837.140103680][-conn0-] Notice: user_session_id from ec_get_user_session_id: 0
[19/Apr/2004:08:15:59][58837.140103680][-conn0-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout?usca%5fp=t
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Notice: checkout.tcl line15 initial from ad_conn user_id: 6823
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Notice: checkout.tcl line17 initial from ec_get_user_session_id: 400
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Notice: user_id from ad_verify_and_get_user_id: 6823
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Notice: user_session_id from ec_get_user_session_id: 400
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Error: shopping cart order has been lost,checkout.tcl line31
[19/Apr/2004:08:16:00][58837.146377728][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/index

How to preserve the new-user basket? Pass the user_session_id through user-new? Transfer the basket contents (in db) to new-user's user_id and new user_session_id? other??

Here is a revised scenario that differentiates the user_session_id value from the cookie value.

[20/Apr/2004:05:05:20][58837.146861056][-conn1-] Notice: Security: 1082437520 sec_generate_session_id_cookie setting 1150033, 0.
[20/Apr/2004:05:05:20][58837.146861056][-conn1-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/?usca%5fp=t

[20/Apr/2004:05:05:41][58837.140103680][-conn0-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560

[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line40 user_id: 0
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line48 from ad_conn, user_id: 0
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line50 set from cookie, user_session_id: 410
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line53 user_session_id: 410
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line55 from cookie, user_session_id: 410
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: LARS: counter = 0 ; this_row? 0 ;next_row? 0
[20/Apr/2004:05:05:41][58837.146377728][-conn4-] Notice: shopping-cart.tcl line136 user_id: 0
[20/Apr/2004:05:05:46][58837.146377728][-conn4-] Notice: checkout.tcl line15 from ad_conn, user_id: 0
[20/Apr/2004:05:05:46][58837.146377728][-conn4-] Notice: checkout.tcl line17 user_session_id from cookie: 410
[20/Apr/2004:05:05:46][58837.146377728][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fc
heckout&http_id=0&user_session_id=410

[20/Apr/2004:05:05:47][58837.146861056][-conn1-] Notice: Security: 1082437547 sec_generate_session_id_cookie setting 1150034, 0.
[20/Apr/2004:05:05:47][58837.146861056][-conn1-] Notice: register/index.tcl line23 user_session_id: 410
[20/Apr/2004:05:05:47][58837.146861056][-conn1-] Notice: register/index.tcl line25 user_session_id from cookie: 0
[20/Apr/2004:05:06:05][58837.146861056][-conn1-] Notice: register/user-login.tcl line27 user_session_id: 410
[20/Apr/2004:05:06:05][58837.146861056][-conn1-] Notice: register/user-login.tcl line29 user_session_id from cookie: 0
[20/Apr/2004:05:06:05][58837.146861056][-conn1-] Notice: register/user-login.tcl line43 user_session_id from cookie: 0
[20/Apr/2004:05:06:06][58837.146861056][-conn1-] Notice: register/user-login.tcl line53 user_session_id from cookie: 0
[20/Apr/2004:05:06:06][58837.146861056][-conn1-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/user-new?email=user76%40dekka%2enet&persistent%5fcookie%5fp=1&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
[20/Apr/2004:05:06:06][58837.146861056][-conn1-] Notice: register/user-login.tcl line55 user_session_id from cookie: 0
[20/Apr/2004:05:06:06][58837.146861056][-conn1-] Notice: register/user-login.tcl line56 user_session_id: 410

[20/Apr/2004:05:06:06][58837.144527360][-conn2-] Notice: register/user-new.tcl line22 user_session_id from cookie: 0
[20/Apr/2004:05:06:06][58837.144527360][-conn2-] Notice: register/user-new.tcl line36, set user_id: 6833
[20/Apr/2004:05:06:30][58837.144527360][-conn2-] Notice: Security: 1082437590 sec_generate_session_id_cookie setting 1150034, 6833.
[20/Apr/2004:05:06:30][58837.144527360][-conn2-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout

[20/Apr/2004:05:06:31][58837.146375680][-conn3-] Notice: checkout.tcl line15 from ad_conn, user_id: 6833
[20/Apr/2004:05:06:31][58837.146375680][-conn3-] Notice: checkout.tcl line17 user_session_id from cookie: 0
[20/Apr/2004:05:06:31][58837.146375680][-conn3-] Notice: user_id from ad_verify_and_get_user_id: 6833
[20/Apr/2004:05:06:31][58837.146375680][-conn3-] Notice: checkout.tcl line27 set from cookie, user_session_id: 0
[20/Apr/2004:05:06:31][58837.146375680][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout?usca%5fp=t

[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line15 from ad_conn, user_id: 6833
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line17 user_session_id from cookie: 411
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: user_id from ad_verify_and_get_user_id: 6833
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line27 set from cookie, user_session_id: 411
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line31 user_session_id from cookie: 411
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line34 user_session_id from cookie: 411
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: checkout.tcl line41 order_id:
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Error: shopping cart order has been lost, checkout.tcl line31
[20/Apr/2004:05:06:31][58837.140103680][-conn0-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/index

Okay, got it to work by

1. passing user_session_id as a param from user-login.tcl to user-new.tcl

2. reinstating the user_session_id cookie from user-new.tcl

For the record, here's how the new-users jump through the ecommerce registration process:

[20/Apr/2004:08:30:56][58837.140103680][-conn0-] Notice: Huh? redirecting: http://dekka.com:8000/ecommerce/shopping-cart?product%5fid=3560
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line40 user_id: 0
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line48 from ad_conn, user_id: 0
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line50 set from cookie, user_session_id: 414
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line53 user_session_id: 414
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line55 from cookie, user_session_id: 414
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: LARS: counter = 0 ; this_row? 0 ; next_row? 0
[20/Apr/2004:08:30:56][58837.146375680][-conn3-] Notice: shopping-cart.tcl line136 user_id: 0
[20/Apr/2004:08:31:00][58837.146375680][-conn3-] Notice: checkout.tcl line15 from ad_conn, user_id: 0
[20/Apr/2004:08:31:00][58837.146375680][-conn3-] Notice: checkout.tcl line17 user_session_id from cookie: 414
[20/Apr/2004:08:31:00][58837.146375680][-conn3-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/index?return_url=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout&http_id=0&user_session_id=414

[20/Apr/2004:08:31:01][58837.146861056][-conn1-] Notice: Security: 1082449861 sec_generate_session_id_cookie setting 1150036, 0.
[20/Apr/2004:08:31:01][58837.146861056][-conn1-] Notice: register/index.tcl line23 user_session_id: 414
[20/Apr/2004:08:31:01][58837.146861056][-conn1-] Notice: register/index.tcl line25 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line27 user_session_id: 414
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line29 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line43 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line53 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/register/user-new?email=user74%40dekka%2enet&persistent%5fcookie%5fp=1&user%5fsession%5fid=414&return%5furl=https%3a%2f%2fdekka%2ecom%3a8443%2fecommerce%2fcheckout
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line55 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146861056][-conn1-] Notice: register/user-login.tcl line56 user_session_id: 414

[20/Apr/2004:08:31:20][58837.146377728][-conn4-] Notice: register/user-new.tcl line22 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146377728][-conn4-] Notice: register/user-new.tcl line24-9 test: ad_set_cookie user_session_id 414
[20/Apr/2004:08:31:20][58837.146377728][-conn4-] Notice: register/user-new.tcl line30 user_session_id from cookie: 0
[20/Apr/2004:08:31:20][58837.146377728][-conn4-] Notice: register/user-new.tcl line36, set user_id: 6837
[20/Apr/2004:08:31:44][58837.146377728][-conn4-] Notice: Security: 1082449904 sec_generate_session_id_cookie setting 1150036, 6837.
[20/Apr/2004:08:31:44][58837.146377728][-conn4-] Notice: Huh? redirecting: https://dekka.com:8443/ecommerce/checkout

[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line15 from ad_conn, user_id: 6837
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line17 user_session_id from cookie: 414
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: user_id from ad_verify_and_get_user_id: 6837
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line27 set from cookie, user_session_id: 414
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line31 user_session_id from cookie: 414
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line34 user_session_id from cookie: 414
[20/Apr/2004:08:31:45][58837.144527360][-conn2-] Notice: checkout.tcl line41 order_id: 3000109