Finlay i made the solution in my style… ![]()
In my cakePHP project when ever i made any Ajax request to my system… my session was lost.. and the new requested controller and action take the place on my session variable. I was totally mad.. because it takes my localization action away… The thing is when ever i change my combo box.. it calls the ajax request and reset my language session value and if any one click on the language flag on that moment my page layout was lost and broke down…
Solutions:
1. Change the CAKE_SECURITY in app core.php to a level of medium or low
(don't worry it will not make any hole in the system and someone says that it can be the solution anyway..)
2. In app_controller set
var $components=array('RequestHandler');
3. Now, inside the beforeRender() method...add
$current_session_value = $this->Session->read('my_sess_var') ;
// this is the session which i want to have it
//What i did just check is ther any Ajax request has occurred.. so i use isAjax()
if ( $this->RequestHandler->isAjax() ) {
$this->Session->write('my_sess_var', null ); //i reset that session which was use to store
$this->Session->write('my_sess_var', $current_session_value ); // re-assign again
}
yahoo…. my problem is solved… no i can change my language whenever i want…



