Re: Sessions, Webserivce and Ajax

2008-02-01 Thread lordG

Hi Guys,

This discussion has not been resolved yet. Could someone elaborate on
the issue being experienced. For example, possible an reason why ajax
sessions which are seen as bare === 1, cause the session not to start.

Thanks,
Greg

On Jan 18, 12:04 pm, lordG [EMAIL PROTECTED] wrote:
 Could you elaborate on this? Which unrelated things?

 I traced the issue to the __start function of the Session Component.

 function __start(){
 if ($this-__started === false) {
 if ($this-__bare === 0) {
 if (!$this-id()  parent::start()) {
 $this-__started = true;
 parent::_checkValid();
 } else {
 $this-__started = parent::start();
 }
 }
 }
 return $this-__started;

 }

 It does not even look at starting the session or checking the
 useragent if the $params['bare'] is not 0. In my tests, Setting
 Configure::write('Session.checkAgent', false) did not change this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sessions, Webserivce and Ajax

2008-01-19 Thread lordG

Nate, Could you elaborate on this?

On Jan 17, 5:42 pm, nate [EMAIL PROTECTED] wrote:
 Dude, you're confusing some very unrelated things.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sessions, Webserivce and Ajax

2008-01-18 Thread lordG

Could you elaborate on this? Which unrelated things?

I traced the issue to the __start function of the Session Component.

function __start(){
if ($this-__started === false) {
if ($this-__bare === 0) {
if (!$this-id()  parent::start()) {
$this-__started = true;
parent::_checkValid();
} else {
$this-__started = parent::start();
}
}
}
return $this-__started;
}

It does not even look at starting the session or checking the
useragent if the $params['bare'] is not 0. In my tests, Setting
Configure::write('Session.checkAgent', false) did not change this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sessions, Webserivce and Ajax

2008-01-17 Thread Chris Hartjes

On Jan 17, 2008 6:37 AM, lordG [EMAIL PROTECTED] wrote:

 Hi Guys,

 Does anyone know why the webservices or ajax calls have not been
 maintained across sessions? Will they be, or am I missing something?

I believe this is related to previous discussions about the user agent
being different for the Ajax calls.  Try changing the following in in
your config/core.php

Configure::write('Session.checkAgent', true);

to

Configure::write('Session.checkAgent', false);

and see if that helps your webservice and Ajax calls.

Hope that helps, and I'm sure others will correct me if I'm wrong.


-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sessions, Webserivce and Ajax

2008-01-17 Thread lordG

Hi Guys,

Does anyone know why the webservices or ajax calls have not been
maintained across sessions? Will they be, or am I missing something?

Thanks,
Greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Sessions, Webserivce and Ajax

2008-01-17 Thread lordG

Hey Chris,

Thanks for the input. I did review that, but could not find valid
cause that it was that. The cake Route class if it finds that the url
is Ajax, sets the $params['bare'] value to 1. As a result, the session
component when checking if it should start the session checks if
$params['bare'] = 0, if so it then starts. therefor any ajax session
wont have session scope even if useragent is false.

The only way for me to resolve this was to return the Route class to
write $params['ajax'] = 1 if a ajax call is found, and then write
adjust my own session class to check if the call was ajax too in order
to keep the session scope.

The other disadvantage here is that because the standard cake session
class relies on $params['bare'] = 0, then all other webservices will
also have no session scope.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---