just moved to AWS and launched 2 RHEL Servers, load-balanced. And installed Apache and PHP. Thats all. And second is even the image of first server.
But suddenly i just noticed the PHP $_SESSION
variables are NOT IN SYNCED. Having differently on each.
After i run this:
<?php
session_start();
if ( $_GET["setvalue"] ) {
$_SESSION["sess_test"] = $_GET["setvalue"];
}
echo "session value: ".$_SESSION["sess_test"];
?>
Then i assign like:
After i assign the Session Value, and refresh again and again (ofcourse by removing the "?setvalue=hello
" portion), the same page is showing 2x different values (as i have two load balanced servers) whenever i refresh.
One is showing:
- session value: hello
And next time is showing:
- session value:
After i give the different value again, only one hitting server is showing the last value and other server is still not get updated with the last value.
ANY IDEA PLEASE? :(