Friday, April 6, 2012

Re: $this->Session->read() is returning loding2.gif

Hello Rajesh,

Even I faced a similar problem yesterday and realized that session is not at all reliable if you are dealing with ajax request. It would be better if you keep the value of unique id in some temperory table in database, and flush the database table once the user gets logged off.


Regards,
Vinit M. Sahasrabudhe

On Wed, Apr 4, 2012 at 11:11 PM, Sdn ngp <sdnfacebook@gmail.com> wrote:
Hello Friends,

 Can any one help me to solve the proble....?

I have written  a code in app controller. to write the value in
session in beforeFilter()

//$this->params['pass'][0] ->  87445d5sd54dsd554

if(!empty($this->params['pass']) && strlen($this->params['pass'][0]) >
6)
{
                   $this->Session->write('uniqueId', $this-
>params['pass'][0]);
                   $uniqueId = $this->Session->read('uniqueId');
}


In app controller it is working fine but when i am loading other
controller via ajax and trying to read the data of session it some
time appeared and some time loading2.gif is displaying.

Because of this issue my session is corrupting the data. I have
broken  my head with this issue
echo $uniqueId = $this->Session->read('uniqueId');

Output:   loading2.gif



--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: