Replace cookie helper set_cookie() with an improved version
as a common function.

Also deprecated CI_Input::set_cookie() which is now an alias
for this new function.

The new function will now replace cookies with the same name
that were already set (either by set_cookie() or the native
setcookie() and header() functions) in the PHP's headers
queue.
This fixes issue #1345 and supersedes PR #1780,
which were aimed at fixing the Session library's behavior
where it sent multiple cookies with the sess_cookie_name
when the session cookie value had changed.

It will now also always send the relatively new Max-Age
cookie attribute (see http://tools.ietf.org/rfc/rfc6265.txt)
and Expire will always be sent as a GMT timestamp, in an
attempt to fix reported issues with Google Chrome (see
issues #1726 and #1908).

Cookies with the Secure attribute that are intended to only
be send by the browser via encrypted connections will no
longer be send if the website is not accessed via HTTPS.

Also, the optional parameters' default values are changed to
NULL instead of actually usable values, so that config_item()
calls are only used if we're sure that the user/developer
didn't set those intentionally.

All usage of the native setcookie() function in CI has been
replaces with set_cookie().
Turns out Max-Age should support negative values - yay
Merge upstream branch
Fix issue #2202 and alter Loader Class docs
Merge pull request #2203 from vlakoff/develop

Adjustments in routing documentation
Fix list_fields seek bug

On the first list_fields call, the field pointer is moved to the end
of the list of fields. This change ensures that the pointer is
positioned at the start of the field list before grabbing the names.

Signed-off-by: Chris Buckley <chris@cmbuckley.co.uk>
Merge pull request #2204 from starsquare/develop

Fix list_fields seek bug
Replace is_file() with the faster file_exists()
(where it makes sense)

Also:
 - Implemented caching of configuration arrays for smileys, foreign characters and doctypes.
 - Implemented cascading-style loading of configuration files (except for library configs, DB and constants.php).
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
[ci skip] Add some changelog entries
Replace CI_Upload::clean_file_name() usage with CI_Security::sanitize_filename()

Also applied @xeptor's fix (a big thanks) to the sanitize_filename() method and added a changelog entry for it - fixes issue #73.
fixed #2207 user guide error

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Merge pull request #2208 from appleboy/userguide

fixed #2207 user guide error
Fix/improve #2211
Remove tests for now non-existent method CI_Upload::clean_file_name()

See 7e5597782a589e4171ca08abdd9ce1a185542ff4
core comment error.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Merge pull request #2213 from appleboy/core

core comment error.
Added some mime types, for newer or older files.
Merge pull request #2216 from kaoz70/develop

Added some mime types, for newer or older files.
Merge changes from develop