I had the same problems I wish there was a way to make this work with security level = high but I didn't figure it out. It seems to be very random. But in general the problem seems to be having 2 requests very quickly after each other
On Jan 26, 3:18 pm, Alfredo Quiroga-Villamil <[email protected]> wrote: > I think I've figured out what was happening. > > If Security.Level is set to high, then cakephp will re-generate the > session id for every request. This seems to cause issues when you have > an application sending multiple ajax requests; for example during > heavy ajax gui initialization. By setting it to medium the issue was > resolved. > > Hope this helps someone in the future as it wasn't apparent to me > right away. I am going to def. spend a bit of time reading over the > core.php file. > > Regards, > > Alfredo > > On Mon, Jan 26, 2009 at 12:31 AM, lawwton <[email protected]> wrote: > > > All: > > > I am having some weird issues using Auth and after some investigation > > with little results I've decided to post some questions since I am > > sure I must be missing something; but I have not been able to find out > > what it is. > > > The issue I have is the following: > > > For some reason after generating 3 ajax requests and also doing this > > after having successfully logged in, my session information seems to > > loose the user information I had received and stored automagically in > > Auth->user(). This sporadically changes, meaning that in some cases I > > can see it for one controller. Then I don't see it after login back in > > and re-running the 3 ajax requests for the different controllers. > > Again I will see the session info (user) for a different controller > > this time > > > Essentially what I am doing is that after I login I load up some > > JavaScripts Objects that I will use for my front-end (GUI) interface. > > I do this by sending 3 ajax requests for example and holding on to the > > information received from them. > > > To add to the confusion after not properly seeing the correct user > > session information set by Auth->user(). I can then continuously call > > the controller/action from my browser and this time I will get the > > session information every time regardless of which controller I use. > > > I have no idea why is behaving like that. Can someone please let me > > know what the possible issue is. The main functions for the 3 > > controllers are shown below. > > > Thanks in advance. > > > In my AppController I have the following: > > > var $components = array('Auth', 'Session', 'RequestHandler'); > > > public function beforeFilter() { > > $this->Auth->loginAction = array('controller' => 'portal', > > 'action' > > => 'login'); > > $this->Auth->loginRedirect = array('controller' => 'portal', > > 'action' => 'main'); > > $this->Auth->logoutRedirect = array('controller' => 'portal', > > 'action' => 'index'); > > $this->Auth->autoRedirect = false; > > } // End of beforeFilter() > > > Then I have 3 controllers to which I send ajax requests via POST. > > > Function from Controller 1: > > > public function getGroups() { > > > $this->layout = 'ajax'; > > $aTariffGroup = array(); > > $this->log("TARIFFGROUPSSSSSSSSSSSSSSSSSSSS", LOG_DEBUG); > > $this->log($_SESSION, LOG_DEBUG); > > > if ( $this->RequestHandler->isAjax() ) { > > > if ( > > $this->User->Group->getGroupName($this->Auth->user > > ('group_id')) != 'superusers' ) { > > $aTariffGroup = > > $this->CcTariffgroup->getGroups($this->Auth->user > > ('tariff_id')); > > } else { > > $aTariffGroup = > > $this->CcTariffgroup->getGroups(); > > } > > > $jTariffGroup = Set::extract($aTariffGroup, > > '{n}.cc_tariffgroup'); > > $this->set('j_groups', $jTariffGroup); > > } > > > } // End of getGroups() > > > Function from Controller 2: > > > public function getTrunkGroups() { > > > $this->log("TRUNKSSSSSSSSSSSSSSS", LOG_DEBUG); > > $this->log($_SESSION, LOG_DEBUG); > > $this->layout = 'ajax'; > > > if ( $this->RequestHandler->isAjax() ) { > > > $iTotalProperty = $this->CcTrunk->find('count'); > > $aTrunks = $this->CcTrunk->find('all'); > > $jTrunks = Set::extract($aTrunks, '{n}.CcTrunk'); > > > $this->set('total', $iTotalProperty); > > $this->set('trunkgroups', $jTrunks); > > > } > > > } // End of getTrunkGroups() > > > Function from Controller 3: > > > public function getGroups() { > > > $this->log("GROUPSSSSSSSSSSSSSSSSSSSSSS", LOG_DEBUG); > > $this->log($_SESSION, LOG_DEBUG); > > > $this->layout = 'ajax'; > > > if ( $this->RequestHandler->isAjax() ) { > > > $i_count = $this->Group->find('count'); > > $a_groups = $this->Group->find('all'); > > $j_groups = Set::extract($a_groups, '{n}.Group'); > > > $this->set('j_groups', $j_groups); > > $this->set('i_total', $i_count); > > > } > > > } // End of getGroups() --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
