PHP offers the key characteristics required of a session management library:
The six functions are:
bool open (string save_path, string sess_name);
This function is executed on the initialization of a session; you should use it to prepare your functions, to initialize variables, or the like. It takes two strings as arguments. The first is the path where sessions should be saved, which is set in php.ini or by the session_save_path() function. You can use this variable for module-specific configuration. The second argument is the session's name, by default the variable $PHPSESSID.bool close ();
This function with no arguments is executed on shutdown of a session. Use it to free memory or to destroy your variables.mixed read (string sess_id, );
This function is called whenever a session is re-started. It must read out the data of the session identified with sess_id and return it as a serialized string. If there's no session with this ID, an empty string "" is returned.bool write (string sess_id, , string value);
When the session needs to be saved, this function is invoked. The first argument is a string containing the session ID; the second argument is the serialized representation of the session variables.bool destroy (string sess_id, );
When a script calls session_destroy(), this function is executed. It should delete all data associated with the session id .bool gc (int max_lifetime, );
This function is called on a session's start-up with the probability specified in gc_probability. It's used for garbage collection; that is, to remove sessions that weren't updated for more than gc_maxlifetime seconds.
Cleaning up old sessions (called "garbage collection") on every page request would cause considerable overhead. Therefore, with gc_maxlifetime, you should use gc_probability. This specifies with what probability the garbage collection routine is invoked. If gc_probability = 100, the cleanup is performed on every request. By default gc=1 meaning old sessions will be removed with a probability of 1% per request.
If you pass the session ID via GET or POST instead, you need to pay
special attention to the garbage collection routines. Users might
bookmark URLs containing the session ID, so you need to make sure that
sessions are cleared frequently. If the session data still exists
when the user accesses the page with the session ID at a later time, PHP
simply resumes the previous session instead of starting with a new session,
which may not be your intention. A value of 10 to 20 for
gc_probability
would better fit this scenario than the default value of 1.
Companies like Yodlee (founded by UCSD CSE professor Venkat Rangan) use screen scraping to collect information fom financial sites about bills and accounts; see http://www.time.com/time/digital/reports/banking/screen.html .
Yahoo Shopping uses screen scraping to buikd its databases of items and prices offered by merchants. Price comparison sites like Addall.com use screen scraping to compile similar information.