How MiniVend Manages Sessions

### Index Up << >>

## How MiniVend Manages Sessions

Normally, each request for a World Wide Web page which comes in to a server stands on its own. While the server will probably know which machine a request comes from, it may not know if the next request comes from the same browser or even from the same user on that machine.

MiniVend keeps track of who is ordering by one of two means:

Cookies
  MiniVend can issue cookies that contain the user session ID. If the user returns the cookie, then they can be presented pages without accompanying session information.

URL re-writing
  If the user doesn't want to use cookies for whatever reason, MiniVend will include in the URL a session id, which is a random piece of text which is different for each customer browsing the catalog.

MiniVend will automatically do the right thing depending on whether the user gives back a cookie.

Pages in the catalog served by MiniVend running as a cgi-bin program generate a special URL for every link. Here is an example of such a URL:

        http://www.minivend.com/cgi-bin/simple/browse1?id=WehUkATn&;pc=122&ar=99-102

An explanation of each part:

www.minivend.com
  Internet address of the server hosting the MiniVend catalog.

cgi-bin
  Informs server that the requested page will be generated by a program. This can be done any way your HTTP server will recognize.

simple
  Name of the program to run -- this is MiniVend's VLINK or TLINK

browse
  Page of the catalog to display

id=WehUkATn
  The session ID

&amp;
  Separates session ID from other other parameters (normal HTTP)

mv_arg=99-102
  An argument which can be used by MiniVend to select page display options.

&amp;
  Separates argument from other parameters (normal HTTP)

mv_pc=122
  A unique integer (or source code, if it contains a letter) which prevents caching servers from caching the URL.

### Index Up << >>