com.caucho.quercus.lib.session
Class SessionModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.session.SessionModule
All Implemented Interfaces:
ModuleStartupListener, QuercusModule

public class SessionModule
extends AbstractQuercusModule
implements ModuleStartupListener

Quercus session handling


Field Summary
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
SessionModule()
           
 
Method Summary
 IniDefinitions getIniDefinitions()
          Returns the default php.ini values.
 java.lang.String[] getLoadedExtensions()
          Returns the extensions loaded by the module.
 Value session_cache_expire(Env env, Value newValue)
           
 Value session_cache_limiter(Env env, Value newValue)
          Returns and/or sets the value of session.cache_limiter, affecting the cache related headers that are sent as a result of a call to session_start(Env).
static Value session_commit(Env env)
          Alias of session_write_close.
static boolean session_decode(Env env, StringValue value)
          Encodes the session values.
static boolean session_destroy(Env env)
          Destroys the session
static java.lang.String session_encode(Env env)
          Encodes the session values.
static ArrayValue session_get_cookie_params(Env env)
          Returns the session cookie parameters
static java.lang.String session_id(Env env, java.lang.String id)
          Returns the session id
static boolean session_is_registered(Env env, StringValue name)
          Returns true if a session variable is registered.
 Value session_module_name(Env env, java.lang.String newValue)
          Returns the object's class name
 Value session_name(Env env, java.lang.String newValue)
          Returns the object's class name
static boolean session_regenerate_id(Env env, boolean deleteOld)
          Regenerates the session id.
 boolean session_register(Env env, Value[] values)
          Registers global variables in the session.
 Value session_save_path(Env env, java.lang.String newValue)
          Returns the session's save path
 Value session_set_cookie_params(Env env, long lifetime, Value path, Value domain, Value isSecure, Value isHttpOnly)
          Sets the session cookie parameters
 boolean session_set_save_handler(Env env, Callable open, Callable close, Callable read, Callable write, Callable destroy, Callable gc)
          Sets the session save handler
static boolean session_start(Env env)
          Start the session
 boolean session_unregister(Env env, Value key)
          Unsets the specified session values
 Value session_unset(Env env)
          Unsets the session values
static Value session_write_close(Env env)
          Writes the session and closes it.
 void startup(Env env)
           
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.quercus.module.QuercusModule
getConstMap
 

Constructor Detail

SessionModule

public SessionModule()
Method Detail

getIniDefinitions

public IniDefinitions getIniDefinitions()
Returns the default php.ini values.

Specified by:
getIniDefinitions in interface QuercusModule
Overrides:
getIniDefinitions in class AbstractQuercusModule

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Description copied from class: AbstractQuercusModule
Returns the extensions loaded by the module.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

startup

public void startup(Env env)
Specified by:
startup in interface ModuleStartupListener

session_cache_limiter

public Value session_cache_limiter(Env env,
                                   Value newValue)
Returns and/or sets the value of session.cache_limiter, affecting the cache related headers that are sent as a result of a call to session_start(Env). If the optional parameter is not supplied, this function simply returns the existing value. If the optional parameter is supplied, the returned value is the old value that was set before the new value is applied. Valid values are "nocache" (the default), "private", "private_no_expire", and "public". If a value other than these values is supplied, then a warning is produced and no cache related headers will be sent to the client.


session_cache_expire

public Value session_cache_expire(Env env,
                                  Value newValue)

session_commit

public static Value session_commit(Env env)
Alias of session_write_close.


session_decode

public static boolean session_decode(Env env,
                                     StringValue value)
Encodes the session values.


session_encode

public static java.lang.String session_encode(Env env)
Encodes the session values.


session_destroy

public static boolean session_destroy(Env env)
Destroys the session


session_get_cookie_params

public static ArrayValue session_get_cookie_params(Env env)
Returns the session cookie parameters


session_id

public static java.lang.String session_id(Env env,
                                          java.lang.String id)
Returns the session id


session_is_registered

public static boolean session_is_registered(Env env,
                                            StringValue name)
Returns true if a session variable is registered.


session_module_name

public Value session_module_name(Env env,
                                 java.lang.String newValue)
Returns the object's class name


session_name

public Value session_name(Env env,
                          java.lang.String newValue)
Returns the object's class name


session_regenerate_id

public static boolean session_regenerate_id(Env env,
                                            boolean deleteOld)
Regenerates the session id. This function first creates a new session id. The old session values are migrated to this new session. Then a new session cookie is sent (XXX: send only if URL rewriting is off?). Changing the session ID should be transparent. Therefore, session callbacks should not be called.


session_register

public boolean session_register(Env env,
                                Value[] values)
Registers global variables in the session.


session_save_path

public Value session_save_path(Env env,
                               java.lang.String newValue)
Returns the session's save path


session_set_cookie_params

public Value session_set_cookie_params(Env env,
                                       long lifetime,
                                       Value path,
                                       Value domain,
                                       Value isSecure,
                                       Value isHttpOnly)
Sets the session cookie parameters


session_set_save_handler

public boolean session_set_save_handler(Env env,
                                        Callable open,
                                        Callable close,
                                        Callable read,
                                        Callable write,
                                        Callable destroy,
                                        Callable gc)
Sets the session save handler


session_start

public static boolean session_start(Env env)
Start the session


session_unregister

public boolean session_unregister(Env env,
                                  Value key)
Unsets the specified session values


session_unset

public Value session_unset(Env env)
Unsets the session values


session_write_close

public static Value session_write_close(Env env)
Writes the session and closes it.