[eluser]Twisted1919[/eluser]
Hi , few moments ago i tried to save the session in database , but had some troubles with ip_address() function .
I am running lighttpd , and the ouput of the $_SERVER looks like :
Code:
Array
(
[PATH] => /sbin:/bin:/usr/sbin:/usr/bin
[SHELL] => /bin/bash
[USER] => Twisted1919
[PHP_FCGI_CHILDREN] => 4
[PHP_FCGI_MAX_REQUESTS] => 10000
[FCGI_ROLE] => RESPONDER
[SERVER_SOFTWARE] => lighttpd/1.4.19
[SERVER_NAME] => host.com
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PORT] => 80
[SERVER_ADDR] => ::ffff:86.34.yy.xx
[REMOTE_PORT] => 60319
[REMOTE_ADDR] => ::ffff:86.34.yy.xx
[SCRIPT_NAME] => /index.php
[PATH_INFO] => /admin
[PATH_TRANSLATED] => /var/www/admin
[SCRIPT_FILENAME] => /var/www/index.php
[DOCUMENT_ROOT] => /var/www/
[REQUEST_URI] => /admin
[REDIRECT_URI] => /index.php/admin
[QUERY_STRING] =>
[REQUEST_METHOD] => GET
[REDIRECT_STATUS] => 200
[SERVER_PROTOCOL] => HTTP/1.1
[HTTP_HOST] => host.com
[HTTP_USER_AGENT] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
[HTTP_ACCEPT_ENCODING] => gzip,deflate
[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
[HTTP_KEEP_ALIVE] => 300
[HTTP_CONNECTION] => keep-alive
[HTTP_REFERER] => http://host.com/action/login_admin
[HTTP_COOKIE] => Blah Blah , Not Important
[ORIG_SCRIPT_FILENAME] => /var/www/index.php/admin
[ORIG_PATH_TRANSLATED] => /var/www/admin
[PHP_SELF] => /index.php/admin
[REQUEST_TIME] => 1250060984
)
So the ip address looks like this
::ffff:86.34.8.46 which obiously is not a valid ipv4 address and the ip_address() from the input class return false on it so in my database all the ip addresses are like 0.0.0.0 .
For the moment i found a workaround to this by str_replace-ing the $_SERVER['REMOTE_ADDR'] from the ip_address() method but i would like to know if this is a bug of CI or just happens with lighttpd ?
Ah , of course , and the real solution to this
P.S: CI from SVN at date .
Thx .