You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got some problems get securimage working in combination with a load balancer. Normal session validation only works by writing them to database. And $_SERVER['REMOTE_ADDR'], which is used as identifier in db also doesn't return the endusers ip, but one of the loadbalancing server. So, captcha code validates only each x times, hitting the right server..
Quick and easy solution for me was to enable db storage, disable session storage, but do an initial session_start() and then replace each $_SERVER['REMOTE_ADDR'] with session_id() in securimage.php
The text was updated successfully, but these errors were encountered:
Sorry for the delayed response. This is a valid issue. To overcome it, the latest version (currently in branch nextgen) creates a unique captcha ID along with each code it generates. The form now must submit a hidden captcha ID input as well as the code. On an unrelated but similar note, I also introduced "storage adapters" so there's a uniform interface to code storage be it in the session, database, memcached, redis or elsewhere. This makes it easy to change your storage backend to a database to get around other session issues with load balancing.
The nextgen branch is production ready and I've been using that code base on a number of sites, and in the WordPress plugin. Unfortunately it hasn't been merged because I haven't done the documentation and site updates.
I'd encourage you to give the nextgen branch a try.
In the securimage config, set 'no_session' => true, and 'use_database' => true, and then set the 'database_driver' => Securimage::SI_DRIVER_MYSQL, as appropriate. It will use PDO_* for connecting. See https://github.com/dapphp/securimage/blob/nextgen/config.inc.php.SAMPLE and the following examples from the WordPress plugin may help as well:
I got some problems get securimage working in combination with a load balancer. Normal session validation only works by writing them to database. And $_SERVER['REMOTE_ADDR'], which is used as identifier in db also doesn't return the endusers ip, but one of the loadbalancing server. So, captcha code validates only each x times, hitting the right server..
Quick and easy solution for me was to enable db storage, disable session storage, but do an initial session_start() and then replace each $_SERVER['REMOTE_ADDR'] with session_id() in securimage.php
The text was updated successfully, but these errors were encountered: