This article is from the CD-Recordable FAQ, by Andy McFadden (firstname.lastname@example.org) with numerous contributions by others.
A disc that you can add data to is "open". All data is written into the
current session. When you have finished writing, you close the session.
If you want to make a multisession disc, you open a new session at the same
time. If you don't open a new session then, you can't open one later,
which means that it's impossible to add more data to the CD-R. The entire
disc is considered "closed".
The process of changing a session from "open" to "closed" is called
"finalizing", "fixating", or just plain "closing" the session. When you
close the last session, you have finalized, fixated, or closed the disc.
A single-session disc has three basic regions: the lead-in, which has the
Table of Contents (or TOC); the program area, with the data and/or audio
tracks; and the lead-out, which is filled with zeroes and provides padding
at the end of the disc. An "open" single-session disc doesn't yet have
the lead-in or lead-out written.
If you write data to a disc and leave the session open, the TOC -- which
tells the CD player or CD-ROM drive where the tracks are -- is written
into a separate area called the Program Memory Area, or PMA. CD recorders
are the only devices that know to look at the PMA, which is why you can't
see data in an open session on a standard playback device. CD players
won't find any audio tracks, and CD-ROM drives won't see a data track.
When the session is finalized, the TOC is written in the lead-in area,
enabling other devices to recognize the disc.
(Something to try: write an audio track to a blank CD, and leave the
session open. Put the disc in a CD player. Some players will deny the
existence of the disc, some will spin the disc up to an incredible speed
and won't even brake the spindle when you eject the disc, others will
perform equally random acts. The TOC is important!)
If you close the current session and open a new one, the lead-in and
lead-out of the current session will be written. A TOC will be written in
the current lead-in that points to the eventual TOC of the next session.
This process is repeated for every closed session, resulting in a chain of
links from one lead-in area to the next. Typical audio CD players don't know
about chasing TOC links, so they can only see tracks in the first session.
Your CD-ROM drive, unless it's broken or fairly prehistoric, will know
about multisession discs and will happily return the first session, last
session, or one somewhere in between, depending on what the OS tells it
and what it is capable of.
Some CD-ROM drives, notably certain early NEC models, are finicky about
open sessions, and will gag when they try to read the lead-in from a
still-open session. They follow the chain of links in the lead-ins of
each session, but when they get to the last, they can't find a valid TOC
and become confused. Even though these drives support multi-session,
they require that the last session be closed before they will read the
disc successfully. Fortunately, most drives don't behave this way.
If you use disc-at-once (DAO) recording, the lead-in is written at the
very start of the process, because the contents of the TOC are known ahead
of time. With most recorders there is no way to specify that more than one
session should be created in DAO mode, so creating a multisession disc with
DAO recording isn't generally possible. Such discs must be created with
track-at-once (TAO) or session-at-once (SAO) recording.
If you're using certain versions of Windows, the Auto Insert Notification
feature will "discover" the CD-R as soon as the TOC is written. This can
cause the write process to fail, which is why Windows software automatically
enables and disables AIN as needed. Otherwise, if recording in track-at-once
mode, it will fail during finalization; in disc-at-once mode, it will fail
near the beginning of the write process. In both cases, test writes will
succeed, because the TOC doesn't get written during a test pass.
Packet-written discs follow the same rules with regard to open and closed
sessions, which is why they have to be finalized before they can be read on
a CD-ROM drive. The "Packet Writing - Intermediate" document in the primer
at http://www.mrichter.com/cdr/primer/primer.htm goes into a little more
detail on this subject. (Some people like to refer to packet writing as
"PAO", for packet-at-once.)
There are gory details beyond what is written here. For example, the
lead-in on a CD-R actually has a pre-recorded TOC that specifies physical
parameters of the recording layer, such as required laser recording power,
and information about the disc, like how many blocks can be written (the
"ATIP" discussed in section (2-38)). You don't usually need to worry
about such things though.