Updated reader and writer for web page usage

Fixed a bug with incorrect prepared statement ordering for session