PTM Logo Version 0.5.1 Beta
Home    SVN    Downloads    Documentation    Forum    Contact
This Site is 100%
Powered by PTM

SourceForge.net Logo
Documentation
I   Index
II   GNU GPL
III   Description
IV   Installation
V   Language Overview
VI   Tags
VII   Variables
VIII   Functions
  _PTM()
  _PTM_FILE()
  append_file_text()
  basic_header()
  delete_cookie()
  end_session()
  get_dir_list()
  get_file_text()
  is_secure()
  is_session()
  nohtml()
  redirect_header()
  session_add()
  session_delete()
  session_domain()
  session_id()
  session_name()
  session_path()
  session_secure()
  set_basic_header()
  set_cookie()
  set_redirect_header()
  start_session()
  update_session()
  write_file_text()
IX   Modules
Documentation
View / Download this file.
----------------------
session_add() FUNCTION
----------------------

  ------------
  USAGE FORMAT
  ------------

    Within a PREPROCESS tag:
    
    &session_add($name, $value);

  -----------
  DESCRIPTION
  -----------

    The session_add() function adds a cookie value to the current PTM Session.
    Alternately, if the cookie value already exists, it changes the cookie's
    value. May be used ONLY in a PREPROCESS tag.
    
    After any modifications have been made using this function, a call to
    update_session() or start_session() MUST be made before ending the
    PREPROCESS tag, otherwise changes will not take effect.

  ---------
  ARGUMENTS
  ---------

    $name

      REQUIRED

      The name of the cookie you wish to create. Behind the scenes, this name
      will be prefixed with 'PTMSESSION' before being sent to the user, and that
      same string will be parsed off before being returned to you.

    $value

      REQUIRED

      The value you wish to store in the named cookie.

  -------
  RETURNS
  -------

    NONE

  --------------
  USAGE EXAMPLES
  --------------

    ----------------------------------------------------------------------
    Example 1: Adding a "Color" Cookie to the Session, If a Session Exists
    ----------------------------------------------------------------------

      <?:
        if (&is_session()) {
          &session_add('Color', 'red');
          &update_session();
        }
      ?>

  --------
  SEE ALSO
  --------

    TAGS

      PREPROCESS

    VARIABLES

      %_COOKIES, %_SESSION, %_SET_COOKIES

    FUNCTIONS

      delete_cookie(), end_session(), is_session(), session_delete(),
      session_domain(), session_id(), session_name(), session_path(),
      session_secure(), set_cookie(), start_session(), update_session()
Home    SVN    Downloads    Documentation    Forum    Contact