Redian新闻
>
急问:shoppingcart在eCommerce中究竟如何实现?
avatar
急问:shoppingcart在eCommerce中究竟如何实现?# Java - 爪哇娇娃
C*w
1
腾讯早就应该花大价钱打造强大的水军队伍了
avatar
z*e
2
明天interview,对方要求很含糊,就是要求做过eCommerce,懂得设计shopping cart。
光是实现shopping cart不难,我觉得有以下4种方法:
1.Cookie
2.Session
3.写入Database
4.EJB中的SessionBean
第4我不考虑,因为对方既然没有提到要求会EJB,那么应该不会问。
第一种用cookie也不可能,因为安全性。
那么通常的设计中到底是采用Session,还是说把所有东西都摆到数据库去??
谢谢!!
另外一个,付费平台的话,就是把form中的数据post到另外一个网址就可以了吗?怎么回
到原网站的?
比如说我在amazon买书,最后付费后,假设是把credit card等信息post到别的交易网站
平台,那么客户浏览器不是也跑到别的网站去了吗?可是实际上浏览器在发送完信息后还
是回到amazon了,这是怎么实现的?
多谢!!
avatar
r*2
3
360水军10万,分到买买提几个不算啥
avatar
w*n
4

好象你的概念有问题, 一般session的实现是用cookie的,没什么大的安全问题.

很多公司提供服务的,比如你可以去cybersource.com去看一下. 我知道的比较多的实
现是用webservice, 同时提供security certificate加密. 你把用户提供的信息全部扔
过去,如果返回ok, 就成交, 不然reject. 甚至你都不用本地记录这些东西. 服务提供
商会帮你log的.



【在 z***e 的大作中提到】
: 明天interview,对方要求很含糊,就是要求做过eCommerce,懂得设计shopping cart。
: 光是实现shopping cart不难,我觉得有以下4种方法:
: 1.Cookie
: 2.Session
: 3.写入Database
: 4.EJB中的SessionBean
: 第4我不考虑,因为对方既然没有提到要求会EJB,那么应该不会问。
: 第一种用cookie也不可能,因为安全性。
: 那么通常的设计中到底是采用Session,还是说把所有东西都摆到数据库去??
: 谢谢!!

avatar
s*k
5
继续关注
avatar
z*e
6
就是说把用户购买了什么东西都写入cookie没关系?
实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie
保险呢?





【在 w******n 的大作中提到】
:
: 好象你的概念有问题, 一般session的实现是用cookie的,没什么大的安全问题.
: 回
: 很多公司提供服务的,比如你可以去cybersource.com去看一下. 我知道的比较多的实
: 现是用webservice, 同时提供security certificate加密. 你把用户提供的信息全部扔
: 过去,如果返回ok, 就成交, 不然reject. 甚至你都不用本地记录这些东西. 服务提供
: 商会帮你log的.
: 站
: 还

avatar
w*n
7
以前买过什么东西放在cookie里没什么大问题. 当然系统如果足够好,
放在database里也许更好.

实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie







【在 z***e 的大作中提到】
: 就是说把用户购买了什么东西都写入cookie没关系?
: 实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie
: 保险呢?
:
: 么
: 网
: 后

avatar
g*s
8
or put sessin id in cookie, shopping cart in session variable.
session object could be stored in application server or database.

【在 w******n 的大作中提到】
: 以前买过什么东西放在cookie里没什么大问题. 当然系统如果足够好,
: 放在database里也许更好.
:
: 实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie
: 怎
: 实
: 扔
: 供
: 易
: 息

avatar
g*g
9
信用卡之类的信息还是不要放cookie里,买什么东西放cookie是没有问题的。

【在 z***e 的大作中提到】
: 就是说把用户购买了什么东西都写入cookie没关系?
: 实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie
: 保险呢?
:
: 么
: 网
: 后

avatar
o*e
10
all info should be saved on server side for reporting and analysis,
if it's not a toy site.

【在 g*****g 的大作中提到】
: 信用卡之类的信息还是不要放cookie里,买什么东西放cookie是没有问题的。
avatar
m*t
11
There are many reasons you definitely want the content of
shopping cart stay on the server, the least but still serious
of which being for the sake of handling those shopping
maniacs (read: too many items to fit into a cookie). 8-)

【在 o***e 的大作中提到】
: all info should be saved on server side for reporting and analysis,
: if it's not a toy site.

avatar
g*s
12
then how about put into hidden fields? hehe.

【在 m******t 的大作中提到】
: There are many reasons you definitely want the content of
: shopping cart stay on the server, the least but still serious
: of which being for the sake of handling those shopping
: maniacs (read: too many items to fit into a cookie). 8-)

avatar
m*t
13

That's what .Net does. You can put all the states in ViewState,
which is essentially an encrypted hidden field and gets carried
back and forth between requests.
But then, the keyword here is "encrypted".

【在 g*s 的大作中提到】
: then how about put into hidden fields? hehe.
avatar
r*l
14
The viewstate is not encrypted, it's just base-64(?) coded.
It's easy to do it in java too.

【在 m******t 的大作中提到】
:
: That's what .Net does. You can put all the states in ViewState,
: which is essentially an encrypted hidden field and gets carried
: back and forth between requests.
: But then, the keyword here is "encrypted".

avatar
r*l
15
Two things I can think of:
1. Anonymous user.
2. Inventory lookup, if not at check out.

【在 z***e 的大作中提到】
: 明天interview,对方要求很含糊,就是要求做过eCommerce,懂得设计shopping cart。
: 光是实现shopping cart不难,我觉得有以下4种方法:
: 1.Cookie
: 2.Session
: 3.写入Database
: 4.EJB中的SessionBean
: 第4我不考虑,因为对方既然没有提到要求会EJB,那么应该不会问。
: 第一种用cookie也不可能,因为安全性。
: 那么通常的设计中到底是采用Session,还是说把所有东西都摆到数据库去??
: 谢谢!!

avatar
m*t
16

I thought base-64 was the default and you could change it to an actual
encryption.
Yes. It wouldn't be too hard, I imagine.

【在 r*****l 的大作中提到】
: The viewstate is not encrypted, it's just base-64(?) coded.
: It's easy to do it in java too.

avatar
p*p
17
Session ID保存在cookie里面,否则必须在URI里面提供





【在 w******n 的大作中提到】
: 以前买过什么东西放在cookie里没什么大问题. 当然系统如果足够好,
: 放在database里也许更好.
:
: 实现是可以这样实现啦,不过如果问到的话,是否需要说几句用HttpSession比用Cookie
: 怎
: 实
: 扔
: 供
: 易
: 息

avatar
r*l
18
It's common to put the ID in URI. Not all browsers support
cookie.

【在 p***p 的大作中提到】
: Session ID保存在cookie里面,否则必须在URI里面提供
:
: 么
: 网
: 后

avatar
d*s
19

Can't I save the id in a hidden field?







【在 p***p 的大作中提到】
: Session ID保存在cookie里面,否则必须在URI里面提供
:
: 么
: 网
: 后

avatar
d*s
20

Not a good behaviour. Some implementations fail to check
client IP. Then this type may have security vulnerabilities.
的实
部扔
提供

【在 r*****l 的大作中提到】
: It's common to put the ID in URI. Not all browsers support
: cookie.

avatar
m*c
21





I don't know how others implemented shopping cart, but the way we did was to
use set of cookies. One of them has shopping cart ID. As long as we can
retrieve the shopping cart ID from the cookie, we are able to recreate
shopping cart. The shopping cart is serialized to XML and saved in the
database. After checking out, the corresponding shopping cart will be removed
from DB, and the cookie that holds shopping cart ID will be reset.
For your second question, B2B transaction is handl

【在 z***e 的大作中提到】
: 明天interview,对方要求很含糊,就是要求做过eCommerce,懂得设计shopping cart。
: 光是实现shopping cart不难,我觉得有以下4种方法:
: 1.Cookie
: 2.Session
: 3.写入Database
: 4.EJB中的SessionBean
: 第4我不考虑,因为对方既然没有提到要求会EJB,那么应该不会问。
: 第一种用cookie也不可能,因为安全性。
: 那么通常的设计中到底是采用Session,还是说把所有东西都摆到数据库去??
: 谢谢!!

avatar
r*l
22

This is a problem with webapp,
not with URL rewritting method. Again, it's possible that
client does not support cookie or just disable cookie.
It's not a good practice to ask the client to enable cookie
before going ahead.

【在 d****s 的大作中提到】
:
: Not a good behaviour. Some implementations fail to check
: client IP. Then this type may have security vulnerabilities.
: 的实
: 部扔
: 提供

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。