cart_session

Description

Cart session.

Cart session id can be transferred via non-secure connection. So the cart session id must be changed when a customer try to make an order.

It is expected to lock cart when customer begins to make an order. And if cart is updated, cart will be unlocked every time. Then, while ordering, CGI should check whether cart is locked or not. If it is not locked, it should stop ordering process.

Definition

Column Type Constraint Description
shop TEXT PRIMARY KEY Shop ID. (shop.username)
session_id TEXT Cart session id. Random string.
cart_id INTEGER NOT NULL Cart ID. (cart.id)
locked INTEGER NOT NULL Cart is locked or not.
  • 0: Un-locked
  • 1: Locked

Related tables

Query

CREATE TABLE cart_session(
shop           TEXT,
session_id     TEXT,
cart_id        INTEGER  NOT NULL,
locked         INTEGER  NOT NULL,
PRIMARY KEY(shop, session_id)
);