<chapter id="sessions-0">
  <title>Session Management</title>
  <highlights>
    <para>This chapter introduces session management, and describes
how to set session defaults. The chapter also contains information on sessions
and login scripts.</para>
  </highlights>
  <sect1 id="sessions-1">
    <title>Introduction to Sessions</title>
    <indexterm>
      <primary>sessions</primary>
      <secondary>introduction</secondary>
    </indexterm>
    <para>A session occurs between the time that a user logs in to
the desktop environment and the time that the user logs out. The session manager
starts after the <application>Login Manager</application> authenticates the
user. The session manager enables the user to manage the session. For example,
a user can save the state of a session and return to that session the next
time that the user logs in. </para>
    <para>At a minimum, the following applications run in a session:</para>
    <itemizedlist>
      <listitem>
        <para>The session manager, <command>gnome-session</command>.</para>
      </listitem>
      <listitem>
        <para>The <application>GConf</application> X settings daemon, <command>gnome-settings-daemon</command>.</para>
      </listitem>
      <listitem>
        <para>The <application>gnome-panel</application> application, which
runs the panels in the desktop environment.</para>
      </listitem>
      <listitem>
        <para>The <application>Metacity</application> window manager.</para>
      </listitem>
    </itemizedlist>
  </sect1>
  <sect1 id="sessions-3">
    <title>Setting Session Defaults</title>
    <indexterm>
      <primary>sessions</primary>
      <secondary>setting defaults</secondary>
    </indexterm>
    <para>The following table lists the files that contain default
session information:</para>
    <informaltable frame="topbot">
      <tgroup cols="2" colsep="0" rowsep="0">
        <colspec colwidth="51.80*"/>
        <colspec colwidth="48.20*"/>
        <thead>
          <row rowsep="1">
            <entry valign="top">
              <para>File</para>
            </entry>
            <entry valign="top">
              <para>Description</para>
            </entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry valign="top">
              <para>
                <filename>/usr/share/gnome/default.session</filename>
              </para>
            </entry>
            <entry valign="top">
              <para>Default session file.
Default session details are stored in this file.</para>
            </entry>
          </row>
          <row>
            <entry valign="top">
              <para>
                <filename>$HOME/.gnome2/session</filename>
              </para>
            </entry>
            <entry valign="top">
              <para>User session file. When a user modifies the session,
the details are stored in this file.</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
    <para>To set default session details for all users, modify the default session
file. </para>
    <para>To restore the default session settings for a user, delete the session
file from the home directory of the user. If no user session file is present,
the default settings in <filename>/usr/share/gnome/default.session</filename>
are used. </para>
    <para>To save the current session as the default session, users can run the <command>gnome-session-save</command> command. </para>
  </sect1>
</chapter>
