A session problem using database(cake-sessions)
I'm planning to use the database session mode in cake 1.3 for load balance through servers. However, in one of my servers, the session expires immediately while i write a session value, and the records in the database is odd and very very long.(The records from other servers are short). It's something like this: Config|N;s:9:"userAgent";s: 0:"";s:4:"time";i: 1339560686;s:7:"timeout";i:10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i:1339560681;s: 7:"timeout";i:10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i:1339560681;s: 7:"timeout";i:10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560681;s: 7:"timeout";i:10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560681;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560681;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560680;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560637;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560636;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560636;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560635;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560634;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:"time";i: 1339560633;s: 7:"timeout";i: 10;}s: 9:"userAgent";s: 0:"";s: 4:&
Re: cakephp 2.0 auth session problem
I am also having an issue with sessions, and I'm very frequently being asked to log back in. Configure::write('Session', array( 'defaults' => 'database', 'ini' => array( 'session.cookie_secure' => false ) )); Configure::write('Security.level', 'medium'); I have a domain that servers both HTTP and HTTPS, so I turned off secure cookies. I have Auth + ACL as well, and had no issue using CakePHP 1.3.x. I am using the database to store session information, and noticed that one user will generate many (10+) number of entries in the cake_sessions table. I'm still looking into AJAX requests being the cause, or I've seen a note about sessions being invalidated if a file (image, css, js, etc.) is not found. I'll be sure to post back if I find a solution, and I must, because this makes the site basically unusable. As an aside, I'm also using the Facebook SDK, but have comment out it's request to start a PHP session so that CakePHP can start it's own. Not sure if anyone else is using the Facebook SDK, but thought I would through that out there. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cakephp 2.0 auth session problem
I am also noticing this problem a lot in 2.0, did either of you get to the bottom of it? It seems to be worse when multiple users are logging into the system at once, even when logging in with different users (does cake prevent concurrent logins with same account?) Regards, Paul. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Session problem
Hi! I have a strange session problem, even if I set to use as defaults - database - data is still not stored there - what is 'better' - I don't know where! How can I debug this thing? Should I set something more except and creating db table: Configure::write('Session', array('defaults' => 'database)); thanks in advance Tomek -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cakephp 2.0 auth session problem
I also experienced quite an amount of unexpected logouts in 2.0 now. To make sure it is not the garbage collector of the file system I switched to "database". There no garbage collector should interfere as long as expires is not reached (which is several days). But the systems logs the user out after not even a few hours. On 16 Nov., 13:11, "joh...@baldemia.com" wrote: > I've recently migrated an application from 1.3 to 2.0, and i'm > encountering a problem with user authentification. > > The app uses a basic auth + acl setup, that worked fine in 1.3. > > First problem i encountered when deploying the app on my production > server (CentOS6, php 5.3.6. mysql 5.1.12) was that the auth component > wouldn't work at all, the session would be instantly regenerated after > login, and the user would be redirected again to the login page. I > managed to solve that by setting a random value to Session.cookie in > core.php. > > All seemed to work now until users started getting randomly logged > out. Problems occurs mostly during ajax calls and more rarely during > normal page calls. I use ajax for a auto-save feature when editing > certain records, a ajax call to a save function is made every 30 > seconds. I wasn't able to pinpoint exactly why the session is > regenerated as it all occurs randomly, app can work perfectly for > hours then suddenly log out the user. > > I tried setting the security level to low or medium as this used to be > a fix session related headaches in cake 1.3, but problem still > persists. > > these are my current session settings: > > Configure::write('Session', array( > 'defaults' => 'php', > 'cookie' => 'appdevtest', > 'checkAgent'=> false, > 'timeout' => 4320 > )); > > Configure::write('Security.level', 'low'); -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
cakephp 2.0 auth session problem
I've recently migrated an application from 1.3 to 2.0, and i'm encountering a problem with user authentification. The app uses a basic auth + acl setup, that worked fine in 1.3. First problem i encountered when deploying the app on my production server (CentOS6, php 5.3.6. mysql 5.1.12) was that the auth component wouldn't work at all, the session would be instantly regenerated after login, and the user would be redirected again to the login page. I managed to solve that by setting a random value to Session.cookie in core.php. All seemed to work now until users started getting randomly logged out. Problems occurs mostly during ajax calls and more rarely during normal page calls. I use ajax for a auto-save feature when editing certain records, a ajax call to a save function is made every 30 seconds. I wasn't able to pinpoint exactly why the session is regenerated as it all occurs randomly, app can work perfectly for hours then suddenly log out the user. I tried setting the security level to low or medium as this used to be a fix session related headaches in cake 1.3, but problem still persists. these are my current session settings: Configure::write('Session', array( 'defaults' => 'php', 'cookie' => 'appdevtest', 'checkAgent'=> false, 'timeout' => 4320 )); Configure::write('Security.level', 'low'); -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: session problem or misunderstanding.
There is a Session helper and a Session component. If you want for all controllers write in app_controllers: var $components = array('Session'); On Dec 20, 2:03 am, "Shinya Koizumi" wrote: > For 1.2.8, How do I enabled that again? I am already using this for another > control, but don't remember > How I did it. > > > > > > > > -Original Message- > From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf > > Of James K > Sent: Sunday, December 19, 2010 7:24 PM > To: CakePHP > Subject: Re: session problem or misunderstanding. > > Do you have the Session component enabled for the controller? If you > debug out $this->Session you should get a debug out of the object. If > you're getting nothing, it could also be that you have debug turned > off in your core.php config file. > > On Dec 19, 9:40 pm, cake-learner wrote: > > I am trying to pass a variale with session but without success for a > > while. > > within the same controller i go $this -> Session -> write( 'id', 1 ); > > $this -> Session -> read( 'id' ); > > > i gotta nothing and empty when i go debug( $this -> Session ); > > I tried with $_SESSION so i guess within the same controller i can't > > pass with session? > > > I have this line $helpers = array( 'Session' ) in the controller and > > there are already some controllers using session. > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: session problem or misunderstanding.
For 1.2.8, How do I enabled that again? I am already using this for another control, but don't remember How I did it. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of James K Sent: Sunday, December 19, 2010 7:24 PM To: CakePHP Subject: Re: session problem or misunderstanding. Do you have the Session component enabled for the controller? If you debug out $this->Session you should get a debug out of the object. If you're getting nothing, it could also be that you have debug turned off in your core.php config file. On Dec 19, 9:40 pm, cake-learner wrote: > I am trying to pass a variale with session but without success for a > while. > within the same controller i go $this -> Session -> write( 'id', 1 ); > $this -> Session -> read( 'id' ); > > i gotta nothing and empty when i go debug( $this -> Session ); > I tried with $_SESSION so i guess within the same controller i can't > pass with session? > > I have this line $helpers = array( 'Session' ) in the controller and > there are already some controllers using session. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: session problem or misunderstanding.
Do you have the Session component enabled for the controller? If you debug out $this->Session you should get a debug out of the object. If you're getting nothing, it could also be that you have debug turned off in your core.php config file. On Dec 19, 9:40 pm, cake-learner wrote: > I am trying to pass a variale with session but without success for a > while. > within the same controller i go $this -> Session -> write( 'id', 1 ); > $this -> Session -> read( 'id' ); > > i gotta nothing and empty when i go debug( $this -> Session ); > I tried with $_SESSION so i guess within the same controller i can't > pass with session? > > I have this line $helpers = array( 'Session' ) in the controller and > there are already some controllers using session. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: session problem or misunderstanding.
did you try to echo var_dump($_SESSION); ? On Dec 19, 9:40 pm, cake-learner wrote: > I am trying to pass a variale with session but without success for a > while. > within the same controller i go $this -> Session -> write( 'id', 1 ); > $this -> Session -> read( 'id' ); > > i gotta nothing and empty when i go debug( $this -> Session ); > I tried with $_SESSION so i guess within the same controller i can't > pass with session? > > I have this line $helpers = array( 'Session' ) in the controller and > there are already some controllers using session. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
session problem or misunderstanding.
I am trying to pass a variale with session but without success for a while. within the same controller i go $this -> Session -> write( 'id', 1 ); $this -> Session -> read( 'id' ); i gotta nothing and empty when i go debug( $this -> Session ); I tried with $_SESSION so i guess within the same controller i can't pass with session? I have this line $helpers = array( 'Session' ) in the controller and there are already some controllers using session. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange Session problem
Hi Jeremy thanks for the response. Typically I have now found the mistake, after posting... this tends to happen to me. Here's what happened. We have an auto-complete input box that uses an ajax call to find the users in the system. Since this can be used multiple times, I cached the results in the session, to make consequent lookups faster. I think what happened is that this was too big for the session to handle, and so the search criteria never actually got persisted. This maybe a database thing since I'm using the database to keep the session information. I removed the learner session caching and it now works like a charm. Good to know that http and https could give problems. I'll bear that in mind when we secure our site a bit more. Thanks again. On Oct 29, 12:14 pm, Jeremy Burns | Class Outfit wrote: > Are you switching between http and https at any time? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 29 Oct 2010, at 05:52, Squire wrote: > > > > > > > > > Hi > > > I've just encountered a really strange problem on one of our > > production sites. This is the scenario: > > > We have a reporting page where a user can put in search criteria. > > Those search criteria are saved in the session, and the data is > > returned. Then the user can download the report. The download action > > uses the search criteria from the session and returns the report. > > > This code works in production on 3 different sites, but this week one > > (after an upgrade) the problem started (only on one site). The code is > > identical as is the database schema, but for some reason, the session > > data gets lost between the requests. The rest of the session stays > > intact. So far I've noticed that the session is there even when the > > view gets displayed, however at the next request in beforeFilter the > > session has lost the report search data. I've put it in code here: > > > getReport() > > ... > > $this->Session->write('Report',$search); > > > downloadReport() > > if (!$this->Session->read('Report')) { > > return; > > } > > > The closest i've come is deleting a whole bunch of records from the > > user table in the offending setup. That helped, but i'm not yet sure > > why and which records. Does anybody have a clue why this would happen? > > It seems to me the data is dropped at the beginning of the > > downloadReport request for some unknown reason!? > > > Any help would be much appreciated. > > Nico > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange Session problem
Are you switching between http and https at any time? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 29 Oct 2010, at 05:52, Squire wrote: > Hi > > I've just encountered a really strange problem on one of our > production sites. This is the scenario: > > We have a reporting page where a user can put in search criteria. > Those search criteria are saved in the session, and the data is > returned. Then the user can download the report. The download action > uses the search criteria from the session and returns the report. > > This code works in production on 3 different sites, but this week one > (after an upgrade) the problem started (only on one site). The code is > identical as is the database schema, but for some reason, the session > data gets lost between the requests. The rest of the session stays > intact. So far I've noticed that the session is there even when the > view gets displayed, however at the next request in beforeFilter the > session has lost the report search data. I've put it in code here: > > getReport() > ... > $this->Session->write('Report',$search); > > downloadReport() > if (!$this->Session->read('Report')) { > return; > } > > The closest i've come is deleting a whole bunch of records from the > user table in the offending setup. That helped, but i'm not yet sure > why and which records. Does anybody have a clue why this would happen? > It seems to me the data is dropped at the beginning of the > downloadReport request for some unknown reason!? > > Any help would be much appreciated. > Nico > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Strange Session problem
Hi I've just encountered a really strange problem on one of our production sites. This is the scenario: We have a reporting page where a user can put in search criteria. Those search criteria are saved in the session, and the data is returned. Then the user can download the report. The download action uses the search criteria from the session and returns the report. This code works in production on 3 different sites, but this week one (after an upgrade) the problem started (only on one site). The code is identical as is the database schema, but for some reason, the session data gets lost between the requests. The rest of the session stays intact. So far I've noticed that the session is there even when the view gets displayed, however at the next request in beforeFilter the session has lost the report search data. I've put it in code here: getReport() ... $this->Session->write('Report',$search); downloadReport() if (!$this->Session->read('Report')) { return; } The closest i've come is deleting a whole bunch of records from the user table in the offending setup. That helped, but i'm not yet sure why and which records. Does anybody have a clue why this would happen? It seems to me the data is dropped at the beginning of the downloadReport request for some unknown reason!? Any help would be much appreciated. Nico Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Session Problem with Auth
Can you explain how that change has anything to do with your original query? Placing your logic in the Users controller is only going to change the layout when they are working with actions from that controller, should that not be in the App controller and have it check if the users is logged in then what user group they are etc? Also I think you need to learn how to use if...else statements or possibly even switch statements as the following is not good logic if($group==1){ $this->layout ='admin'; } if($group==2){ $this->layout = 'manager'; }else{ $this->layout = 'default'; } should be if($group==1){ $this->layout ='admin'; }elseif($group==2){ $this->layout = 'manager'; }else{ $this->layout = 'default'; } or switch($this->session->read('Auth.User.group_id')) { case '1': $this->layout = 'admin'; break; case '2': $this->layout = 'manager'; break; default: $this->layout = 'default'; } HTH Paul. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Session Problem with Auth
I am able to log in. the problem is solved by changing following setting in core.php Configure::write('Session.checkAgent', false); thanks for your response. On May 24, 4:00 pm, John Andersen wrote: > Can you log in? > Enjoy, > John > > On May 24, 1:49 pm, Hussain wrote: > > > > > > > I am developing application cakephp 1.2.7. For that there are > > different user level. > > for different users I have added code in users controller > > $users = $this->Session->read('Auth.User'); > > //print_r($users); > > $user_type = $users['group_id']; > > $group =$user_type; > > if($group==1){ > > $this->layout ='admin'; > > > } > > if($group==2){ > > $this->layout = 'manager'; > > > } > > else{ > > $this->layout = 'default'; > > } > > while i am not getting info about user from Auth session. each time > > its empty and layout i am getting is default. > > Can anybody help me regarding this? > > thanks in advance > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Session Problem with Auth
Can you log in? Enjoy, John On May 24, 1:49 pm, Hussain wrote: > I am developing application cakephp 1.2.7. For that there are > different user level. > for different users I have added code in users controller > $users = $this->Session->read('Auth.User'); > //print_r($users); > $user_type = $users['group_id']; > $group =$user_type; > if($group==1){ > $this->layout ='admin'; > > } > if($group==2){ > $this->layout = 'manager'; > > } > else{ > $this->layout = 'default'; > } > while i am not getting info about user from Auth session. each time > its empty and layout i am getting is default. > Can anybody help me regarding this? > thanks in advance > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Session Problem with Auth
I am developing application cakephp 1.2.7. For that there are different user level. for different users I have added code in users controller $users = $this->Session->read('Auth.User'); //print_r($users); $user_type = $users['group_id']; $group =$user_type; if($group==1){ $this->layout ='admin'; } if($group==2){ $this->layout = 'manager'; } else{ $this->layout = 'default'; } while i am not getting info about user from Auth session. each time its empty and layout i am getting is default. Can anybody help me regarding this? thanks in advance Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
some session problem in cakephp 1.3 (help me)
i have this app_controller code in cakephp 1.2: params['admin'])) { // Set the default layout $this->layout = 'admin'; }else { $this->layout = 'default'; } //Override default fields used by Auth component $this->Auth->fields = array('username'=>'email_address','password'=>'password'); //Set application wide actions which do not require authentication $this->Auth- >allow(array('display','view','admin_login','index','pindex'));// IMPORTANT for CakePHP 1.2 final release change this to $this->Auth- >allow(array('display')); //Set the default redirect for users who logout $this->Auth->logoutRedirect = '/'; //Set the default redirect for users who login $this->Auth->loginRedirect = '/admin/images/index'; //Extend auth component to include authorisation via isAuthorized action $this->Auth->authorize = 'controller'; //Restrict access to only users with an active account $this->Auth->userScope = array('User.active = 1'); //Pass auth component data over to view files $this->set('Auth',$this->Auth->user()); } /** * beforeRender * * Application hook which runs after each action but, before the view file is * rendered * * @access public */ function beforeRender(){ //If we have an authorised user logged then pass over an array of controllers //to which they have index action permission if($this->Auth->user()){ $controllerList = Configure::listObjects('controller'); $permittedControllers = array(); foreach($controllerList as $controllerItem){ if($controllerItem <> 'App'){ if($this->__permitted($controllerItem,'index')){ $permittedControllers[] = $controllerItem; } } } } $this->set(compact('permittedControllers')); } /** * isAuthorized * * Called by Auth component for establishing whether the current authenticated * user has authorization to access the current controller:action * * @return true if authorised/false if not authorized * @access public */ function isAuthorized(){ return $this->__permitted($this->name,$this->action); } /** * __permitted * * Helper function returns true if the currently authenticated user has permission * to access the controller:action specified by $controllerName: $actionName * @return * @param $controllerName Object * @param $actionName Object */ function __permitted($controllerName,$actionName){ //Ensure checks are all made lower case $controllerName = low($controllerName); $actionName = low($actionName); //If permissions have not been cached to session... if(!$this->Session->check('Permissions')){ //...then build permissions array and cache it $permissions = array(); //everyone gets permission to logout $permissions[]='users:logout'; //Import the User Model so we can build up the permission cache App::import('Model', 'User'); $thisUser = new User; //Now bring in the current users full record along with groups $thisGroups = $thisUser->find(array('User.id'=>$this->Auth- >user('id'))); $thisGroups = $thisGroups['Group']; foreach($thisGroups as $thisGroup){ $thisPermissions = $thisUser->Group- >find(array('Group.id'=>$thisGroup['id'])); $thisPermissions = $thisPermissions['Permission']; foreach($thisPermissions as $thisPermission){ $permissions[]=$thisPermission['name']; } } //write the permissions array to session $this->Session->write('Permissions',$permissions); }else{ //...they have been cached already, so retrieve them $permissions = $this->Session->read('Permissions'); var_dump($permissions); } //Now iterate through permissions for a positive match foreach($permissions as $permission){ if($permission == '*'){ return true;//Super Admin Bypass Found } if($permission == $controllerName.':*'){ return true;//Controller Wide Bypass Found } if($permission == $controllerName.':'.$actionName){ return true;//Specific permission found } } return false; } } ?> when i am run this code in cakephp 1.3 i dont see variable in session (var_dump($permissions);) where is problem? note: this code for "cakephp user Auth" Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP relate
Re: interesting session problem - session is lost and recovers again randomly
Are you using IE? And making Ajax calls? or launching applets? I had this problem for the last few days. The fix is to set Configure::write('Session.checkAgent', false); in core.php The reason is: IE sometimes uses a different user agent string when doing ajax calls, and so will any applets you launch from the browser. Also, set Configure::write('Security.level', 'medium'); Just in case the session is timing out too quickly. On Feb 1, 7:59 pm, "ecommy.com" wrote: > Greetings, > > I am building a web application which uses a simple auth login system > which was inspired from the cake manual. Nothing fancy. > > Everything was fine on localhost, but when I uploaded to a linux > server, the user gets logger in and out randomly by just browsing > through the application. > > I am interested if someone else was getting into a similar problem. > > Thank you! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
interesting session problem - session is lost and recovers again randomly
Greetings, I am building a web application which uses a simple auth login system which was inspired from the cake manual. Nothing fancy. Everything was fine on localhost, but when I uploaded to a linux server, the user gets logger in and out randomly by just browsing through the application. I am interested if someone else was getting into a similar problem. Thank you! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: session problem in AppController - some research and strange results
On Thu, Sep 17, 2009 at 11:18 PM, Dr. Loboto wrote: > > If I remember right, afterFilter is not called on redirect. Cake team > have some reasons for it. That's because redirect() should immediately leave the action, so running afterFilter() would be undesirable. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: session problem in AppController - some research and strange results
If I remember right, afterFilter is not called on redirect. Cake team have some reasons for it. On Sep 17, 6:51 pm, Ace wrote: > Hi, > > I have strange problem with cakephp session. I have few controllers > that needs date changing logic for the stats so I moved all the needed > methods to app_controller. Since then I struggle with a problem of > losing session data. The main idea is simple: date is being kept in > the session, in beforeFilter I've got: > > $this->time=$this->Session->read('time'); > > and in afterFilter: > > $this->Session->write('time',$this->time); > > Every modification of time variable should be saved to the session as > you can see, but it is getting wiped out with every redirect.. during > the battle, I've figured out that if I add ob_start() at the begining > of AppController::beforeFilter() and ob_flush() at the end of > AppController::afterFilter() then it works fine. At that time I was > satisfied with the result, but the problem came back when I changed > debug level to 0. Research showed that cake is losing session data if > debug level is 0 or when it is higher but there is no output buffering > added to the before and after filters of the AppController. > > Anybody has any clue why is that? And how this can be fixed? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
session problem in AppController - some research and strange results
Hi, I have strange problem with cakephp session. I have few controllers that needs date changing logic for the stats so I moved all the needed methods to app_controller. Since then I struggle with a problem of losing session data. The main idea is simple: date is being kept in the session, in beforeFilter I've got: $this->time=$this->Session->read('time'); and in afterFilter: $this->Session->write('time',$this->time); Every modification of time variable should be saved to the session as you can see, but it is getting wiped out with every redirect.. during the battle, I've figured out that if I add ob_start() at the begining of AppController::beforeFilter() and ob_flush() at the end of AppController::afterFilter() then it works fine. At that time I was satisfied with the result, but the problem came back when I changed debug level to 0. Research showed that cake is losing session data if debug level is 0 or when it is higher but there is no output buffering added to the before and after filters of the AppController. Anybody has any clue why is that? And how this can be fixed? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session Problem...
Thanks Kyo... Now its showing no probs.. Aneesh S On Sat, Nov 22, 2008 at 3:56 PM, Kyo <[EMAIL PROTECTED]> wrote: > > Set the 'Security.level' to 'medium' in /app/config/core.php > CakePHP regenerates session IDs for every request if 'Security.level' > is set to 'high'. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session Problem...
Set the 'Security.level' to 'medium' in /app/config/core.php CakePHP regenerates session IDs for every request if 'Security.level' is set to 'high'. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Session Problem...
Hi, Need help on session... In my project, at the user side , after login, the login session seems to be destroyed after some clicks on the user's links. It happens very often in IE (8) and less often in FireFox (3). It seems to happen after the the user uses the chat facility. I've checked my codes but couldnt find any trouble there. Also it happens only sometimes. Is there any way to overcome this. Client is not happy with this logout problem. Pls help me out here... Thanks in advance Aneesh S illustris software solutions pvt ltd. TBI, NITC, Calicut, Kerala, INDIA - 673 601 [EMAIL PROTECTED] | www.illustris.in --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
The Lost Session Problem
Hey Guys, I have accepted the fact that setting the Session.security = 'high' will regenerate session id on each request. However, when I set the Session.security = 'medium' it actually sets the session Cookie to expire in the future. This to me is a big security problem. Is there anyway to have the best of both worlds? I don't want my sessions to regenerate on each request but I'd like the Cookie itself to expire when the browser closes. I have a lot of ajax in my applications and the regenerate method just isn't working for me, too many impatient people are losing their session data. Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
CakePHP - Session Problem
@filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP (tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 * @version $Revision: 6296 $ * @modifiedby $LastChangedBy: phpnut $ * @lastmodified$Date: 2008-01-01 16:18:17 -0600 (Tue, 01 Jan 2008) $ The problem is: in the login action I set session variable for user and then redirect. After redirect cakephp is losing session. I tried with CAKE_SESSION_SAVE - 'php', 'cake' (with sessions folder writable), CAKE_SECURITY - 'high', 'medium','low' Nothing works. I searched on group but found no solution. the code i have written is $login_name=$this->params['data']['User']['txtUname']; $this->usercount = $this->User->query("select count(*) as countval from medstat_users.users as User where PWD = '".$this->params ['data']['User']['txtPass']."'"); if($this->usercount['0']['0']['countval']=='1') { $this->User1 = $this->User->query("select * from medstat_users.users as User WHERE LoginID = '".$login_name."' AND PWD = '".$this->params['data']['User']['txtPass']."' and islocked < 3 "); $this->Session->write('SESSION_ADMIN_ID', $this->User1[0]['User'] ['ID']); $this->Session->write('SESSION_ADMIN_NAME', $this->User1[0] ['User']['LoginID']); $this->Session->write('SESSION_APP_ID', $this->User1[0]['User'] ['App_ID']); $this->Session->write('SESSION_DOC_ADDRESS', $this->User1[0] ['User']['Address']); $this->Session->write('SESSION_DOC_PHONE', $this->User1[0] ['User']['Phone']); $this->Session->write('SESSION_DOC_QALFY', $this->User1[0] ['User']['Qualification']); $this->redirect('/users/search'); } /** search function **/ function search() { $this->checkSession(); } function checkSession() { if (!$this->Session->read('SESSION_ADMIN_ID')) { $this->flash('Please Login to Access the Application','/users/ login'); } $this->set('SESSION_ADMIN_LEVEL',$this->Session->read ('SESSION_ADMIN_LEVEL')); $this->set('SESSION_ADMIN_ID',$this->Session->read ('SESSION_ADMIN_ID')); $this->set('SESSION_ADMIN_NAME',$this->Session->read ('SESSION_ADMIN_NAME')); $this->set('SESSION_TYPE',$this->Session->read('SESSION_TYPE')); } I request you to please give me a solution for the issue. Thanks & Regards, Vidya Hasten --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Strange session problem
Hi again, I think I found the solution: I named the session cookie foo.bar. If I call it foo_bar it works. Are dots not allowed in cookie names? Regards Guenther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Strange session problem
Hi, I'm using Cake 1.2.0.7296 RC2 on a local LAMP machine and I ran into a problem: There a two sites "foo.local" and "bar.local", both have identical apache configuration files. They use different cake installation but (as far as I can see) the configuration files are identical (except for the salt). On both sites I added the following to beforeFilter in app_controller: $this->Session->write('test.' . rand(), rand()); debug ($this->Session->read()); Now, if I reload the sites several times I would expect the test-array in my session to grow. Unfortunetaly this only works on of the sites. On the other site I only get one changing entry in the test-array. It seems like on one site somehow the session data is not saved at all. Which is bad, especially if you try to implent Auth and ACL... ;-) I'm a little bit lost now. Anybody any hints? Regards Guenther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
I am experiencing a similar issue, but a more subtle one. The solutions provided in the links do not help. I've tried them all. Here's what I'm trying to do: I keep an array of the last 10 URLs on my site the user has visited in the session variable 'urlBackTrack'. With every page the user lands on, in beforeRender() in app_controller, I add the current URL to the first array entry ( key [0] ) or this variable, like so: $urlBackTrack = $this->Session->read('urlBackTrack'); array_unshift($urlBackTrack,$this->here); $this->Session->write('urlBackTrack', $urlBackTrack); The problem I have is that for some pages, this process works fine. But for other pages, when I debug the array, it shows that the current URL was successfully added, but then when I move onto another page through the site, that new array ( key [0] ) entry is now gone, as if it wasn't written at all. I am also checking the session id ( $this->Session->id() ) and it is the same throughout the site. I've changed the security level to low and medium, I set checkUserAgent to false, etc, etc. What am I missing? On Jun 10, 10:38 am, Andrew Assarattanakul <[EMAIL PROTECTED]> wrote: > Check a few of these discussions as a few other people have had this > issue and resolved it. > > http://groups.google.com/group/cake-php/browse_thread/thread/c4b30b02...http://groups.google.com/group/cake-php/browse_thread/thread/b173577d... > > On Jun 10, 5:20 am, koko <[EMAIL PROTECTED]> wrote: > > > Anybody found a solution to this ?? I am having the exact same > > problem here !! > > > On May 21, 5:25 am, Ozzy OG Kush <[EMAIL PROTECTED]> wrote: > > > > Hey, > > > > I am having this same exact problem! I'm using CakePHP 1.1.19.6305 . > > > > This is very frustrating! Any help would be very appreciated. > > > > On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote: > > > > > Did you ever find a solution to this? I think I am experiencing a > > > > similar problem. I can write to asessionvariable, but I can only > > > > read the valid value if I do so before the action completes. Once the > > > > action completes and a new one is called, thesessioninformation is > > > > gone. I am extremely new to cake and would love to know the solution. > > > > Thanks! > > > > > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > > > I still have not succeded in this... The strange thing is that im > > > > > using the Auth component, and im pretty sure It usessessions. What I > > > > > dont know if it uses them with $_SESSION or with thesession > > > > > component, but I would bet for the second. > > > > > > Quite strange.. I'll try in other cake instalations around and see. > > > > > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, thanks! here it is: > > > > > > > Configure::write('Session.save', 'php'); //also tried with 'cake' > > > > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > > > > Configure::write('Session.timeout', '120'); > > > > > > Configure::write('Session.start', true); > > > > > > Configure::write('Session.checkAgent', true); //also tried with > > > > > > false > > > > > > Configure::write('Security.level', 'low'); > > > > > > > Right now im asigning with $_SESSION and reading withSession > > > > > > Component :D hahahah > > > > > > > Thanks for the help! > > > > > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > > > > > > How is your core.php configured? Post what you have for all > > > > > > > Configure::write('Session.*', '...') and whether they are > > > > > > > uncommented > > > > > > > or not. > > > > > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> > > > > > > > wrote: > > > > > > > > > Hi. Im having a strange problem, and couldn't find any > > > > > > > > solution or > > > > > > > > anyone with a similar problem... Its quite simple: > > > > > > > > > same controller, 2 methods: > > > > > > > > > function sessionWriteTest ($key, $value) { > > > > > > > > $this->Session->write($key, $value); > > > > > > > > } > > > > > > > > function sessionReadTest ($key) { > > > > > > > > debug($this->Session->read($key)); > > > > > > > > } > > > > > > > > > doesnt work... > > > > > > > > > modifying the method sessionWriteTest like this, works: > > > > > > > > function sessionWriteTest ($key, $value) { > > > > > > > > $_SESSION[$key] = $value; > > > > > > > > } > > > > > > > > > Am Imissingsomething really simple? My config is set quite > > > > > > > > default, > > > > > > > > temp directories are chmod 777, and normalsessionhandling > > > > > > > > works! > > > > > > > > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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.
Re: Session problem with phpcaptcha component in Cake 1.1
I figured it out. I needed to exclude 'users/captcha' from my __validateLoginStatus method, that's all. On Jun 26, 11:23 am, skoggins <[EMAIL PROTECTED]> wrote: > Hi All, > > I am trying to use the phpcaptcha component with Cake 1.1. and I find > that it works fine when a user is logged in but the image does not > appear when no one is logged into the site. THis makes me think it is > an issue with phpcaptcha needing a Session to be started before it can > appear but I have tried starting and stopping Sessions to no avail. > > Anyone have any ideas? Here is are my default option in php- > captcha.inc.php" > > / Default Options **/ > >// start a PHP session - this class uses sessions to store the > generated >// code. Comment out if you are calling already from your > application > > //session_start(); > >// class defaults - change to effect globally > >define('CAPTCHA_SESSION_ID', 'php_captcha'); >define('CAPTCHA_WIDTH', 200); // max 500 >define('CAPTCHA_HEIGHT', 50); // max 200 >define('CAPTCHA_NUM_CHARS', 5); >define('CAPTCHA_NUM_LINES', 70); >define('CAPTCHA_CHAR_SHADOW', false); >define('CAPTCHA_OWNER_TEXT', ''); >define('CAPTCHA_CHAR_SET', ''); // defaults to A-Z >define('CAPTCHA_CASE_INSENSITIVE', true); >define('CAPTCHA_BACKGROUND_IMAGES', ''); >define('CAPTCHA_MIN_FONT_SIZE', 16); >define('CAPTCHA_MAX_FONT_SIZE', 25); >define('CAPTCHA_USE_COLOUR', true); >define('CAPTCHA_FILE_TYPE', 'jpeg'); >define('CAPTCHA_FLITE_PATH', '/usr/bin/flite'); >define('CAPTCHA_AUDIO_PATH', '/tmp/'); // must be writeable by PHP > process > > and here is my image fcn from captcha.php: > > function image(){ > //$imagesPath = realpath(VENDORS . 'phpcaptcha').'/fonts/'; > $imagesPath = APP . 'vendors' . DS . 'phpcaptcha'.'/fonts/'; > $aFonts = array( > $imagesPath.'VeraBd.ttf', > $imagesPath.'VeraIt.ttf', > $imagesPath.'Vera.ttf' > ); > > $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60); > $oVisualCaptcha->UseColour(false); > //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL); > $oVisualCaptcha->SetNumChars(6); > $oVisualCaptcha->Create(); > } > > Other than that I haven't changed anything from the code provided in > the bakery. > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Session problem with phpcaptcha component in Cake 1.1
Hi All, I am trying to use the phpcaptcha component with Cake 1.1. and I find that it works fine when a user is logged in but the image does not appear when no one is logged into the site. THis makes me think it is an issue with phpcaptcha needing a Session to be started before it can appear but I have tried starting and stopping Sessions to no avail. Anyone have any ideas? Here is are my default option in php- captcha.inc.php" / Default Options **/ // start a PHP session - this class uses sessions to store the generated // code. Comment out if you are calling already from your application //session_start(); // class defaults - change to effect globally define('CAPTCHA_SESSION_ID', 'php_captcha'); define('CAPTCHA_WIDTH', 200); // max 500 define('CAPTCHA_HEIGHT', 50); // max 200 define('CAPTCHA_NUM_CHARS', 5); define('CAPTCHA_NUM_LINES', 70); define('CAPTCHA_CHAR_SHADOW', false); define('CAPTCHA_OWNER_TEXT', ''); define('CAPTCHA_CHAR_SET', ''); // defaults to A-Z define('CAPTCHA_CASE_INSENSITIVE', true); define('CAPTCHA_BACKGROUND_IMAGES', ''); define('CAPTCHA_MIN_FONT_SIZE', 16); define('CAPTCHA_MAX_FONT_SIZE', 25); define('CAPTCHA_USE_COLOUR', true); define('CAPTCHA_FILE_TYPE', 'jpeg'); define('CAPTCHA_FLITE_PATH', '/usr/bin/flite'); define('CAPTCHA_AUDIO_PATH', '/tmp/'); // must be writeable by PHP process and here is my image fcn from captcha.php: function image(){ //$imagesPath = realpath(VENDORS . 'phpcaptcha').'/fonts/'; $imagesPath = APP . 'vendors' . DS . 'phpcaptcha'.'/fonts/'; $aFonts = array( $imagesPath.'VeraBd.ttf', $imagesPath.'VeraIt.ttf', $imagesPath.'Vera.ttf' ); $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60); $oVisualCaptcha->UseColour(false); //$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL); $oVisualCaptcha->SetNumChars(6); $oVisualCaptcha->Create(); } Other than that I haven't changed anything from the code provided in the bakery. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
Check a few of these discussions as a few other people have had this issue and resolved it. http://groups.google.com/group/cake-php/browse_thread/thread/c4b30b02adaf4a9f/f71248fa3cb18220 http://groups.google.com/group/cake-php/browse_thread/thread/b173577dbca8b3f9# On Jun 10, 5:20 am, koko <[EMAIL PROTECTED]> wrote: > Anybody found a solution to this ?? I am having the exact same > problem here !! > > On May 21, 5:25 am, Ozzy OG Kush <[EMAIL PROTECTED]> wrote: > > > Hey, > > > I am having this same exact problem! I'm using CakePHP 1.1.19.6305 . > > > This is very frustrating! Any help would be very appreciated. > > > On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote: > > > > Did you ever find a solution to this? I think I am experiencing a > > > similar problem. I can write to a session variable, but I can only > > > read the valid value if I do so before the action completes. Once the > > > action completes and a new one is called, the session information is > > > gone. I am extremely new to cake and would love to know the solution. > > > Thanks! > > > > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > > I still have not succeded in this... The strange thing is that im > > > > using the Auth component, and im pretty sure It usessessions. What I > > > > dont know if it uses them with $_SESSION or with thesession > > > > component, but I would bet for the second. > > > > > Quite strange.. I'll try in other cake instalations around and see. > > > > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > > > Hi, thanks! here it is: > > > > > > Configure::write('Session.save', 'php'); //also tried with 'cake' > > > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > > > Configure::write('Session.timeout', '120'); > > > > > Configure::write('Session.start', true); > > > > > Configure::write('Session.checkAgent', true); //also tried with false > > > > > Configure::write('Security.level', 'low'); > > > > > > Right now im asigning with $_SESSION and reading withSession > > > > > Component :D hahahah > > > > > > Thanks for the help! > > > > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > > > > > How is your core.php configured? Post what you have for all > > > > > > Configure::write('Session.*', '...') and whether they are > > > > > > uncommented > > > > > > or not. > > > > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> > > > > > > wrote: > > > > > > > > Hi. Im having a strange problem, and couldn't find any solution > > > > > > > or > > > > > > > anyone with a similar problem... Its quite simple: > > > > > > > > same controller, 2 methods: > > > > > > > > function sessionWriteTest ($key, $value) { > > > > > > > $this->Session->write($key, $value); > > > > > > > } > > > > > > > function sessionReadTest ($key) { > > > > > > > debug($this->Session->read($key)); > > > > > > > } > > > > > > > > doesnt work... > > > > > > > > modifying the method sessionWriteTest like this, works: > > > > > > > function sessionWriteTest ($key, $value) { > > > > > > > $_SESSION[$key] = $value; > > > > > > > } > > > > > > > > Am I missing something really simple? My config is set quite > > > > > > > default, > > > > > > > temp directories are chmod 777, and normalsessionhandling works! > > > > > > > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
Anybody found a solution to this ?? I am having the exact same problem here !! On May 21, 5:25 am, Ozzy OG Kush <[EMAIL PROTECTED]> wrote: > Hey, > > I am having this same exact problem! I'm using CakePHP 1.1.19.6305 . > > This is very frustrating! Any help would be very appreciated. > > On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote: > > > Did you ever find a solution to this? I think I am experiencing a > > similar problem. I can write to a session variable, but I can only > > read the valid value if I do so before the action completes. Once the > > action completes and a new one is called, the session information is > > gone. I am extremely new to cake and would love to know the solution. > > Thanks! > > > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > I still have not succeded in this... The strange thing is that im > > > using the Auth component, and im pretty sure It usessessions. What I > > > dont know if it uses them with $_SESSION or with thesession > > > component, but I would bet for the second. > > > > Quite strange.. I'll try in other cake instalations around and see. > > > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > > Hi, thanks! here it is: > > > > > Configure::write('Session.save', 'php'); //also tried with 'cake' > > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > > Configure::write('Session.timeout', '120'); > > > > Configure::write('Session.start', true); > > > > Configure::write('Session.checkAgent', true); //also tried with false > > > > Configure::write('Security.level', 'low'); > > > > > Right now im asigning with $_SESSION and reading withSession > > > > Component :D hahahah > > > > > Thanks for the help! > > > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > > > > How is your core.php configured? Post what you have for all > > > > > Configure::write('Session.*', '...') and whether they are uncommented > > > > > or not. > > > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> > > > > > wrote: > > > > > > > Hi. Im having a strange problem, and couldn't find any solution or > > > > > > anyone with a similar problem... Its quite simple: > > > > > > > same controller, 2 methods: > > > > > > > function sessionWriteTest ($key, $value) { > > > > > > $this->Session->write($key, $value); > > > > > > } > > > > > > function sessionReadTest ($key) { > > > > > > debug($this->Session->read($key)); > > > > > > } > > > > > > > doesnt work... > > > > > > > modifying the method sessionWriteTest like this, works: > > > > > > function sessionWriteTest ($key, $value) { > > > > > > $_SESSION[$key] = $value; > > > > > > } > > > > > > > Am I missing something really simple? My config is set quite > > > > > > default, > > > > > > temp directories are chmod 777, and normalsessionhandling works! > > > > > > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
Hey, I am having this same exact problem! I'm using CakePHP 1.1.19.6305 . This is very frustrating! Any help would be very appreciated. On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote: > Did you ever find a solution to this? I think I am experiencing a > similar problem. I can write to a session variable, but I can only > read the valid value if I do so before the action completes. Once the > action completes and a new one is called, the session information is > gone. I am extremely new to cake and would love to know the solution. > Thanks! > > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > I still have not succeded in this... The strange thing is that im > > using the Auth component, and im pretty sure It uses sessions. What I > > dont know if it uses them with $_SESSION or with thesession > > component, but I would bet for the second. > > > Quite strange.. I'll try in other cake instalations around and see. > > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > > Hi, thanks! here it is: > > > > Configure::write('Session.save', 'php'); //also tried with 'cake' > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > Configure::write('Session.timeout', '120'); > > > Configure::write('Session.start', true); > > > Configure::write('Session.checkAgent', true); //also tried with false > > > Configure::write('Security.level', 'low'); > > > > Right now im asigning with $_SESSION and reading withSession > > > Component :D hahahah > > > > Thanks for the help! > > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > > > How is your core.php configured? Post what you have for all > > > > Configure::write('Session.*', '...') and whether they are uncommented > > > > or not. > > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> wrote: > > > > > > Hi. Im having a strange problem, and couldn't find any solution or > > > > > anyone with a similar problem... Its quite simple: > > > > > > same controller, 2 methods: > > > > > > function sessionWriteTest ($key, $value) { > > > > > $this->Session->write($key, $value); > > > > > } > > > > > function sessionReadTest ($key) { > > > > > debug($this->Session->read($key)); > > > > > } > > > > > > doesnt work... > > > > > > modifying the method sessionWriteTest like this, works: > > > > > function sessionWriteTest ($key, $value) { > > > > > $_SESSION[$key] = $value; > > > > > } > > > > > > Am I missing something really simple? My config is set quite default, > > > > > temp directories are chmod 777, and normalsessionhandling works! > > > > > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem Firefox
not for me, a single app running on a single sub-domain. I only notice the session drops when I edit/save files through an ssh shell. Will do some testing to make sure that that's it though. On Sun, May 18, 2008 at 12:08 PM, leveille <[EMAIL PROTECTED]> wrote: > > Out of curiosity, you don't happen to have two apps running on the > same domain, both with a config/core.php? In this case, I have seen > problems before where Configure::write('Session.cookie', 'CAKEPHP');, > defined in both, causes a clash of cookies in some instances, > consequently dropping a session. > > On May 17, 10:13 am, RugerJ <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm having session problems only when using Firefox or Safari. > > When I update or insert a record the data is saved but I get > > redirected to the login page. > > The weird thing is that the session seems alive, cos I can see the > > user variables in the menu. > > I haven't got any redirects to the login page in the controller or my > > app_controller a bit confusing. > > > > I'm using cake 1.9 and tried every solution given on this forum. > > I hope someone can help me! > > > -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem Firefox
Out of curiosity, you don't happen to have two apps running on the same domain, both with a config/core.php? In this case, I have seen problems before where Configure::write('Session.cookie', 'CAKEPHP');, defined in both, causes a clash of cookies in some instances, consequently dropping a session. On May 17, 10:13 am, RugerJ <[EMAIL PROTECTED]> wrote: > Hello, > > I’m having session problems only when using Firefox or Safari. > When I update or insert a record the data is saved but I get > redirected to the login page. > The weird thing is that the session seems alive, cos I can see the > user variables in the menu. > I haven’t got any redirects to the login page in the controller or my > app_controller a bit confusing. > > I’m using cake 1.9 and tried every solution given on this forum. > I hope someone can help me! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem Firefox
If you could give us a little more information about this, that would be extremely helpful. I run into a similar problem with Firefox, where the session will be dropped. This seems to happen when I'm editing files though, so I have a feeling that that might be causing the problems. I'm using Beta: 1.2.0.631, and the latest version of the othAuth component for logins. I've checked all of my models, and controllers, and there are no extra spaces or anything before the declarations in those files. On Sat, May 17, 2008 at 9:13 AM, RugerJ <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm having session problems only when using Firefox or Safari. > When I update or insert a record the data is saved but I get > redirected to the login page. > The weird thing is that the session seems alive, cos I can see the > user variables in the menu. > I haven't got any redirects to the login page in the controller or my > app_controller a bit confusing. > > I'm using cake 1.9 and tried every solution given on this forum. > I hope someone can help me! > > > > -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Session problem Firefox
Hello, I’m having session problems only when using Firefox or Safari. When I update or insert a record the data is saved but I get redirected to the login page. The weird thing is that the session seems alive, cos I can see the user variables in the menu. I haven’t got any redirects to the login page in the controller or my app_controller a bit confusing. I’m using cake 1.9 and tried every solution given on this forum. I hope someone can help me! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~--~~~~--~~--~--~---
Session problem: New session on every page view
Howdy, I'm using Cake 1.2 and storing sessions in the database using the built-in functions, but I'm having a problem with sessions. A normal Cake 1.2 installation set up this way inserts one row in the Sessions table per visitor. If security is High the session id is recreated in that row. If security is Medium, the session id is not recreated until the timeout. Either way there is one row per visitor. For some reason, my application is creating a new row (new session id) for each page view, meaning the user's session id is changing with each view. Even refreshing the same page causes a new row and a new session id. I wouldn't even care, except that it means I can't persist user information across pages, which of course I need to do. I've replaced all my Cake libraries with the current 1.2 ones, I've tried storing sessions using Configure::write('Session.save', 'cake'); but I still get a new file for each page view for the same visitor, just like above. I've tested a default 1.2 installation using the same test computer with the same browser and same browser settings (allow cookies, etc). Has anyone seen this before? Obviously something in my app. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
Did you ever find a solution to this? I think I am experiencing a similar problem. I can write to a session variable, but I can only read the valid value if I do so before the action completes. Once the action completes and a new one is called, the session information is gone. I am extremely new to cake and would love to know the solution. Thanks! On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > I still have not succeded in this... The strange thing is that im > using the Auth component, and im pretty sure It uses sessions. What I > dont know if it uses them with $_SESSION or with thesession > component, but I would bet for the second. > > Quite strange.. I'll try in other cake instalations around and see. > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > Hi, thanks! here it is: > > > Configure::write('Session.save', 'php'); //also tried with 'cake' > > Configure::write('Session.cookie', 'CAKEPHP'); > > Configure::write('Session.timeout', '120'); > > Configure::write('Session.start', true); > > Configure::write('Session.checkAgent', true); //also tried with false > > Configure::write('Security.level', 'low'); > > > Right now im asigning with $_SESSION and reading withSession > > Component :D hahahah > > > Thanks for the help! > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > > How is your core.php configured? Post what you have for all > > > Configure::write('Session.*', '...') and whether they are uncommented > > > or not. > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> wrote: > > > > > Hi. Im having a strange problem, and couldn't find any solution or > > > > anyone with a similar problem... Its quite simple: > > > > > same controller, 2 methods: > > > > > function sessionWriteTest ($key, $value) { > > > > $this->Session->write($key, $value); > > > > } > > > > function sessionReadTest ($key) { > > > > debug($this->Session->read($key)); > > > > } > > > > > doesnt work... > > > > > modifying the method sessionWriteTest like this, works: > > > > function sessionWriteTest ($key, $value) { > > > > $_SESSION[$key] = $value; > > > > } > > > > > Am I missing something really simple? My config is set quite default, > > > > temp directories are chmod 777, and normalsessionhandling works! > > > > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" 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: Session problem
I still have not succeded in this... The strange thing is that im using the Auth component, and im pretty sure It uses sessions. What I dont know if it uses them with $_SESSION or with the session component, but I would bet for the second. Quite strange.. I'll try in other cake instalations around and see. On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > Hi, thanks! here it is: > > Configure::write('Session.save', 'php'); //also tried with 'cake' > Configure::write('Session.cookie', 'CAKEPHP'); > Configure::write('Session.timeout', '120'); > Configure::write('Session.start', true); > Configure::write('Session.checkAgent', true); //also tried with false > Configure::write('Security.level', 'low'); > > Right now im asigning with $_SESSION and reading with Session > Component :D hahahah > > Thanks for the help! > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > > How is your core.php configured? Post what you have for all > > Configure::write('Session.*', '...') and whether they are uncommented > > or not. > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> wrote: > > > > Hi. Im having a strange problem, and couldn't find any solution or > > > anyone with a similar problem... Its quite simple: > > > > same controller, 2 methods: > > > > function sessionWriteTest ($key, $value) { > > > $this->Session->write($key, $value); > > > } > > > function sessionReadTest ($key) { > > > debug($this->Session->read($key)); > > > } > > > > doesnt work... > > > > modifying the method sessionWriteTest like this, works: > > > function sessionWriteTest ($key, $value) { > > > $_SESSION[$key] = $value; > > > } > > > > Am I missing something really simple? My config is set quite default, > > > temp directories are chmod 777, and normal session handling works! > > > > Thanks! --~--~-~--~~~---~--~~ 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: Session problem
Hi, thanks! here it is: Configure::write('Session.save', 'php'); //also tried with 'cake' Configure::write('Session.cookie', 'CAKEPHP'); Configure::write('Session.timeout', '120'); Configure::write('Session.start', true); Configure::write('Session.checkAgent', true); //also tried with false Configure::write('Security.level', 'low'); Right now im asigning with $_SESSION and reading with Session Component :D hahahah Thanks for the help! On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote: > How is your core.php configured? Post what you have for all > Configure::write('Session.*', '...') and whether they are uncommented > or not. > > On Mon, Apr 14, 2008 at 1:35 PM, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > > Hi. Im having a strange problem, and couldn't find any solution or > > anyone with a similar problem... Its quite simple: > > > same controller, 2 methods: > > > function sessionWriteTest ($key, $value) { > > $this->Session->write($key, $value); > > } > > function sessionReadTest ($key) { > > debug($this->Session->read($key)); > > } > > > doesnt work... > > > modifying the method sessionWriteTest like this, works: > > function sessionWriteTest ($key, $value) { > > $_SESSION[$key] = $value; > > } > > > Am I missing something really simple? My config is set quite default, > > temp directories are chmod 777, and normal session handling works! > > > Thanks! --~--~-~--~~~---~--~~ 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: Session problem
How is your core.php configured? Post what you have for all Configure::write('Session.*', '...') and whether they are uncommented or not. On Mon, Apr 14, 2008 at 1:35 PM, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > Hi. Im having a strange problem, and couldn't find any solution or > anyone with a similar problem... Its quite simple: > > same controller, 2 methods: > > function sessionWriteTest ($key, $value) { > $this->Session->write($key, $value); > } > function sessionReadTest ($key) { > debug($this->Session->read($key)); > } > > doesnt work... > > modifying the method sessionWriteTest like this, works: > function sessionWriteTest ($key, $value) { > $_SESSION[$key] = $value; > } > > Am I missing something really simple? My config is set quite default, > temp directories are chmod 777, and normal session handling works! > > Thanks! > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session problem
Hi. Im having a strange problem, and couldn't find any solution or anyone with a similar problem... Its quite simple: same controller, 2 methods: function sessionWriteTest ($key, $value) { $this->Session->write($key, $value); } function sessionReadTest ($key) { debug($this->Session->read($key)); } doesnt work... modifying the method sessionWriteTest like this, works: function sessionWriteTest ($key, $value) { $_SESSION[$key] = $value; } Am I missing something really simple? My config is set quite default, temp directories are chmod 777, and normal session handling works! Thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session problem
If I change value of dropdown list, I change value of session. Every time I need refresh page to make session alive. Why? In dropdown list I use javascript MM_jumpMenu() to refresh page, but that is not enought. {foreach from=$langs item=lang} {$lang.I18nLang.name} {/foreach} --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
session problem
I've session problem in CakePHP 1.1.19, because when I'm sailing in pages, the session expiring! the timeout is define('CAKE_SESSION_TIMEOUT', '120'); somebody had this problem? --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
...okay installed the nightly and this now works. On Jan 30, 10:06 pm, Richard <[EMAIL PROTECTED]> wrote: > I have the same problem since upgrading to 1.2 beta from alpha. I need > to add @session_start(); to each action even though Session.start is > set to true. Did you manage to find a fix? > > On Jan 7, 1:03 pm, phpcurious <[EMAIL PROTECTED]> wrote: > > > I have almost the same problem as you do with regards to theSession.start. > > I do this in Cakephp 1.1.x when setting sessions: > > define('AUTO_SESSION', false); > > define('CAKE_SESSION_SAVE', 'database'); > > define('CAKE_SESSION_TABLE', 'cake_sessions'); > > define('CAKE_SESSION_TIMEOUT', '120'); > > > but when I tried it in cakephp 1.2 beta with this settings: > > Configure::write('Session.save', 'database'); > > Configure::write('Session.table', 'cake_sessions'); > > Configure::write('Session.database', 'default'); > > Configure::write('Session.start', false); > > > the same kind of error appears: > > Fatal error: Class 'ConnectionManager' not found in ... > > > please tell me if I have done something wrong, or if I have forgotten > > something else... > > thanks... > > > On Jan 7, 12:42 am, pravinda <[EMAIL PROTECTED]> wrote: > > > > Hi Everybody, > > > It was my wrong manipulation. The actual problem is I want to get some > > >sessiondata in routes.php itself, because my application is more than > > > 99% ajax based and I don't want to change the url in the address bar. > > > So, while login I set somesessionvariable for next action and then > > > refresh the page, in routes.php I fetch the action fromsessionand > > > then set the action in a variable > > > then > > > if(!isset($_SESSION)) // this I need to do because unless Istartthe > > >sessionI can not usesessionvariable. > > > @session_start(); > > > $action = 'display'; > > > if(isset(sessionvariable)) > > > $action = getsessionvariable; > > > Router::connect('/', array('controller' => 'pages', 'action' => > > > $action, 'home')); > > > > If I use session_start(); here ( as I was using in prebeta) then after > > > this I need to use session_start(); every where. if I don't use > > > session_start(); here I cann't get thesessionvariable in routes.php > > > and if I do I session_start(); here then in other pages like in > > > controller this creates the problem --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
I have the same problem since upgrading to 1.2 beta from alpha. I need to add @session_start(); to each action even though Session.start is set to true. Did you manage to find a fix? On Jan 7, 1:03 pm, phpcurious <[EMAIL PROTECTED]> wrote: > I have almost the same problem as you do with regards to theSession.start. > I do this in Cakephp 1.1.x when setting sessions: > define('AUTO_SESSION', false); > define('CAKE_SESSION_SAVE', 'database'); > define('CAKE_SESSION_TABLE', 'cake_sessions'); > define('CAKE_SESSION_TIMEOUT', '120'); > > but when I tried it in cakephp 1.2 beta with this settings: > Configure::write('Session.save', 'database'); > Configure::write('Session.table', 'cake_sessions'); > Configure::write('Session.database', 'default'); > Configure::write('Session.start', false); > > the same kind of error appears: > Fatal error: Class 'ConnectionManager' not found in ... > > please tell me if I have done something wrong, or if I have forgotten > something else... > thanks... > > On Jan 7, 12:42 am, pravinda <[EMAIL PROTECTED]> wrote: > > > Hi Everybody, > > It was my wrong manipulation. The actual problem is I want to get some > >sessiondata in routes.php itself, because my application is more than > > 99% ajax based and I don't want to change the url in the address bar. > > So, while login I set somesessionvariable for next action and then > > refresh the page, in routes.php I fetch the action fromsessionand > > then set the action in a variable > > then > > if(!isset($_SESSION)) // this I need to do because unless Istartthe > >sessionI can not usesessionvariable. > > @session_start(); > > $action = 'display'; > > if(isset(sessionvariable)) > > $action = getsessionvariable; > > Router::connect('/', array('controller' => 'pages', 'action' => > > $action, 'home')); > > > If I use session_start(); here ( as I was using in prebeta) then after > > this I need to use session_start(); every where. if I don't use > > session_start(); here I cann't get thesessionvariable in routes.php > > and if I do I session_start(); here then in other pages like in > > controller this creates the problem --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
I have almost the same problem as you do with regards to the Session.start. I do this in Cakephp 1.1.x when setting sessions: define('AUTO_SESSION', false); define('CAKE_SESSION_SAVE', 'database'); define('CAKE_SESSION_TABLE', 'cake_sessions'); define('CAKE_SESSION_TIMEOUT', '120'); but when I tried it in cakephp 1.2 beta with this settings: Configure::write('Session.save', 'database'); Configure::write('Session.table', 'cake_sessions'); Configure::write('Session.database', 'default'); Configure::write('Session.start', false); the same kind of error appears: Fatal error: Class 'ConnectionManager' not found in ... please tell me if I have done something wrong, or if I have forgotten something else... thanks... On Jan 7, 12:42 am, pravinda <[EMAIL PROTECTED]> wrote: > Hi Everybody, > It was my wrong manipulation. The actual problem is I want to get some > session data in routes.php itself, because my application is more than > 99% ajax based and I don't want to change the url in the address bar. > So, while login I set some session variable for next action and then > refresh the page, in routes.php I fetch the action from session and > then set the action in a variable > then > if(!isset($_SESSION)) // this I need to do because unless I start the > session I can not use session variable. > @session_start(); > $action = 'display'; > if(isset(session variable)) > $action = get session variable; > Router::connect('/', array('controller' => 'pages', 'action' => > $action, 'home')); > > If I use session_start(); here ( as I was using in prebeta) then after > this I need to use session_start(); every where. if I don't use > session_start(); here I cann't get the session variable in routes.php > and if I do I session_start(); here then in other pages like in > controller this creates the problem --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
Hi Everybody, It was my wrong manipulation. The actual problem is I want to get some session data in routes.php itself, because my application is more than 99% ajax based and I don't want to change the url in the address bar. So, while login I set some session variable for next action and then refresh the page, in routes.php I fetch the action from session and then set the action in a variable then if(!isset($_SESSION)) // this I need to do because unless I start the session I can not use session variable. @session_start(); $action = 'display'; if(isset(session variable)) $action = get session variable; Router::connect('/', array('controller' => 'pages', 'action' => $action, 'home')); If I use session_start(); here ( as I was using in prebeta) then after this I need to use session_start(); every where. if I don't use session_start(); here I cann't get the session variable in routes.php and if I do I session_start(); here then in other pages like in controller this creates the problem --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
Hi Robby, Thanks to reply, but I already done this but still this problem persist. I have already written in my topic about this. -pravin --~--~-~--~~~---~--~~ 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: start session problem in cakephp1.2 beta
When you upgraded, did you diff the various control files and walk through the updates? You _should_ have this line somewhere in your core.php in app/config (in mine it is on line 131): Configure::write('Session.start', true); That is all you should need to do to get sessions to auto-start. -r --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
start session problem in cakephp1.2 beta
Hi everybody, I have used cakephp prebeta, now cakephp1.2 beta is released. There were some problem in prebeta in form helper so now I am trying to use beta version. In this version I am facing a session problem in core.php I have set Configure::write('Session.timeout', '120'); Configure::write('Session.start', true); Configure::write('Session.checkAgent', true); Now when I am doing login login I need to set some variable in session like $this->Session->write('User', $lo[0]['User']); but before doing this I need to write session_start(); then only the session variables are set Can anybody tell me this very urgently, because I am doing a 99% ajax based application so I need to set many variables, earlier I have used versions before pre beta, then pre beta and now beta. the versions before prebeta were good for me. Thanking you in advance. my email id ([EMAIL PROTECTED]) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
cake 1.2 requestAction + Session problem
I have a login controller that handles session check and login function and other controllers that request session check to the login controller. Here is my problem, in cake 1.1 it's just fine, but when i switch to cake 1.2 i get this error message : Notice (8): Undefined variable: _SESSION [CORE\cake\libs\session.php, line 195] Code | Context $name = "admin_id" $var= "admin_id" return false; } $result = Set::extract($_SESSION, $var); CakeSession::check() - CORE\cake\libs\session.php, line 195 SessionComponent::check() - CORE\cake\libs\controller\components \session.php, line 197 LoginController::logincheck() - APP\controllers\login_controller.php, line 37 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 268 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 240 Object::requestAction() - CORE\cake\libs\object.php, line 105 HomeController::beforeFilter() - APP\controllers\home_controller.php, line 10 Dispatcher::start() - CORE\cake\dispatcher.php, line 312 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 226 [main] - APP\webroot\index.php, line 89 if i move the code from logincheck function in login_controller to beforefilter in home_controller the problem is gone, so the real problem is the requestAction. Is there any other workaround? my login_controller : - Session->read('admin_id')){ $this->redirect('/home/'); } $this->pageTitle='Control Panel :: Login'; $this->set('username_error', 'Username Must be Filled'); $this->set('password_error', 'Password be Filled'); if($this->data){ $this->Admin->set($this->data); if($this->Admin->validates()){ if($login=$this->Admin->findByUsername($this->data['Admin'] ['username'])){ if($login && $login['Admin']['password']==md5($this->data['Admin'] ['password'])){ $this->Session->write('admin_id', $this->data['Admin'] ['username']); $this->redirect('/home/'); }else{ $this->set('password_error', 'Invalid Password '); $this->Admin->invalidate('password'); } } else{ $this->set('username_error', 'Username not Registered'); $this->Admin->invalidate('username'); } }else{ $this->validateErrors($this->Admin); } } } function logincheck(){ if($this->Session->check('admin_id')){ return true; }else{ $this->Session->setFlash('Not logged-in or session timeout', null, null, 'login'); $this->redirect('/login'); exit(); } } } ?> my other controller (in this case home_controller) --- requestAction('/login/logincheck'); } function index(){ $this->pageTitle='Control Panel'; $this->set('moduls', $this->Modul->findAll("status = '1'")); } function logout(){ $this->Session->delete('admin_id'); $this->redirect('./'); } } ?> --~--~-~--~~~---~--~~ 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: Session problem ....
I have been having a similar (if not the exact) issue with 1.2. Sessions worked well in my dev setup (wamp on my laptop), but not in production. Setting the Session.checkAgent to False in config/core.php seems to have corrected the issue for me. On Dec 18, 12:18 pm, hausburger <[EMAIL PROTECTED]> wrote: > > 1) With Debug set at level 3 do you see the app inserting multiple > >sessionrecords in your database? > > not at the same time. > > > 2) Are you using any AJAX calls? > > not in my testcase. > > > 3) Are you making any requestAction calls? > > no. > > > 4) Have you tried turning 'Session.checkAgent' to false? (Does the > > issue persist if you do?) > > it doesn't matter. > > > > there are 2sessionrows in the DB. > at the pages without the expectetsessiondata exist 2session > cookies. > when i delete the "wrong" cookie everything works fine. > > the question is: when/where was the cookie created? > > > > > On Dec 18, 10:51 am, stefuNz <[EMAIL PROTECTED]> wrote: > > > > ok ... using lowercase functions read() and write() doesn't work, > > > too ... :/ > > > > On 18 Dez., 12:29, hausburger <[EMAIL PROTECTED]> wrote: > > > > > hi everyone. just for your information: > > > > - i tried database and cake assessionstorage (same problem) > > > > - Configure::write('Security.level', 'medium'); > > > > > the problem seems to be the cookie: > > > > > -- > > > > NameCAKEPHP > > > > Value dc5d17d748ce14a4a7fe6bcfebe5911c > > > > Hostmy.domain.com > > > > Path/ > > > > Secure No > > > > Expires Tue, 25 Dec 2007 11:11:12 GMT > > > > -- > > > > NameCAKEPHP > > > > Value b4bc42c1fe39d0b2b2a68dc431580ed7 > > > > Hostmy.domain.com > > > > Path/members/ > > > > Secure No > > > > Expires Fri, 17 Dec 2032 15:42:20 GMT > > > > -- > > > > > 2sessioncookies are stored. > > > > > At the my.domain/members/ (this is the controller i set > > > > user_login_data tosession) the session_data is not accessable - but i > > > > any other place like: > > > > my.domain/ or my.domain/photos/ everything looks fine. > > > > > ... > > > > any idea? > > > > > On 18 Dez., 12:13, stefuNz <[EMAIL PROTECTED]> wrote: > > > > > > hi everyone, > > > > > > thanks for all the replies! > > > > > but nothing helped :( > > > > > i'm using 1.2.0.5875 pre-beta > > > > > and now i'm posting my core.phpsessionsettings, maybe i have > > > > > something wrong here !? > > > > > (when it's set to database, sometimes the database table is filled by > > > > > somesessionstuff i guess .. but there are several records) > > > > > > Configure::write('Session.save', 'database'); > > > > > Configure::write('Session.table', 'cake_sessions'); // exists > > > > > Configure::write('Session.database', 'default'); // set to default, so > > > > > it automatically picks my database.php default database right?! > > > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > > > Configure::write('Session.timeout', '3600'); > > > > > Configure::write('Session.start', true); > > > > > Configure::write('Session.checkAgent', true); > > > > > > On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > > > > > > > hi stefan, > > > > > > > just a quick question cos I have just ran into this problem about an > > > > > > hour ago. > > > > > > > are you using the latest nightly or the 5875 release? Cos i'm > > > > > > having > > > > > > problems with thesessionnot storing anything in the latest > > > > > > nightly... and going back to the pre-beta release fixed it. > > > > > > > I'm still looking into it- Hide quoted text - > > > > - Show quoted text - --~--~-~--~~~---~--~~ 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: Session problem ....
> 1) With Debug set at level 3 do you see the app inserting multiple > session records in your database? not at the same time. > 2) Are you using any AJAX calls? not in my testcase. > 3) Are you making any requestAction calls? no. > 4) Have you tried turning 'Session.checkAgent' to false? (Does the > issue persist if you do?) it doesn't matter. there are 2 session rows in the DB. at the pages without the expectet session data exist 2 session cookies. when i delete the "wrong" cookie everything works fine. the question is: when/where was the cookie created? > > On Dec 18, 10:51 am, stefuNz <[EMAIL PROTECTED]> wrote: > > > ok ... using lowercase functions read() and write() doesn't work, > > too ... :/ > > > On 18 Dez., 12:29, hausburger <[EMAIL PROTECTED]> wrote: > > > > hi everyone. just for your information: > > > - i tried database and cake as session storage (same problem) > > > - Configure::write('Security.level', 'medium'); > > > > the problem seems to be the cookie: > > > > -- > > > NameCAKEPHP > > > Value dc5d17d748ce14a4a7fe6bcfebe5911c > > > Hostmy.domain.com > > > Path/ > > > Secure No > > > Expires Tue, 25 Dec 2007 11:11:12 GMT > > > -- > > > NameCAKEPHP > > > Value b4bc42c1fe39d0b2b2a68dc431580ed7 > > > Hostmy.domain.com > > > Path/members/ > > > Secure No > > > Expires Fri, 17 Dec 2032 15:42:20 GMT > > > -- > > > > 2 session cookies are stored. > > > > At the my.domain/members/ (this is the controller i set > > > user_login_data to session) the session_data is not accessable - but i > > > any other place like: > > > my.domain/ or my.domain/photos/ everything looks fine. > > > > ... > > > any idea? > > > > On 18 Dez., 12:13, stefuNz <[EMAIL PROTECTED]> wrote: > > > > > hi everyone, > > > > > thanks for all the replies! > > > > but nothing helped :( > > > > i'm using 1.2.0.5875 pre-beta > > > > and now i'm posting my core.php session settings, maybe i have > > > > something wrong here !? > > > > (when it's set to database, sometimes the database table is filled by > > > > some session stuff i guess .. but there are several records) > > > > > Configure::write('Session.save', 'database'); > > > > Configure::write('Session.table', 'cake_sessions'); // exists > > > > Configure::write('Session.database', 'default'); // set to default, so > > > > it automatically picks my database.php default database right?! > > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > > Configure::write('Session.timeout', '3600'); > > > > Configure::write('Session.start', true); > > > > Configure::write('Session.checkAgent', true); > > > > > On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > > > > > > hi stefan, > > > > > > just a quick question cos I have just ran into this problem about an > > > > > hour ago. > > > > > > are you using the latest nightly or the 5875 release? Cos i'm having > > > > > problems with the session not storing anything in the latest > > > > > nightly... and going back to the pre-beta release fixed it. > > > > > > I'm still looking into it- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ 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: Session problem ....
Questions that would help me (any maybe others) diagnose the problem. 1) With Debug set at level 3 do you see the app inserting multiple session records in your database? 2) Are you using any AJAX calls? 3) Are you making any requestAction calls? 4) Have you tried turning 'Session.checkAgent' to false? (Does the issue persist if you do?) On Dec 18, 10:51 am, stefuNz <[EMAIL PROTECTED]> wrote: > ok ... using lowercase functions read() and write() doesn't work, > too ... :/ > > On 18 Dez., 12:29, hausburger <[EMAIL PROTECTED]> wrote: > > > > > hi everyone. just for your information: > > - i tried database and cake as session storage (same problem) > > - Configure::write('Security.level', 'medium'); > > > the problem seems to be the cookie: > > > -- > > NameCAKEPHP > > Value dc5d17d748ce14a4a7fe6bcfebe5911c > > Hostmy.domain.com > > Path/ > > Secure No > > Expires Tue, 25 Dec 2007 11:11:12 GMT > > -- > > NameCAKEPHP > > Value b4bc42c1fe39d0b2b2a68dc431580ed7 > > Hostmy.domain.com > > Path/members/ > > Secure No > > Expires Fri, 17 Dec 2032 15:42:20 GMT > > -- > > > 2 session cookies are stored. > > > At the my.domain/members/ (this is the controller i set > > user_login_data to session) the session_data is not accessable - but i > > any other place like: > > my.domain/ or my.domain/photos/ everything looks fine. > > > ... > > any idea? > > > On 18 Dez., 12:13, stefuNz <[EMAIL PROTECTED]> wrote: > > > > hi everyone, > > > > thanks for all the replies! > > > but nothing helped :( > > > i'm using 1.2.0.5875 pre-beta > > > and now i'm posting my core.php session settings, maybe i have > > > something wrong here !? > > > (when it's set to database, sometimes the database table is filled by > > > some session stuff i guess .. but there are several records) > > > > Configure::write('Session.save', 'database'); > > > Configure::write('Session.table', 'cake_sessions'); // exists > > > Configure::write('Session.database', 'default'); // set to default, so > > > it automatically picks my database.php default database right?! > > > Configure::write('Session.cookie', 'CAKEPHP'); > > > Configure::write('Session.timeout', '3600'); > > > Configure::write('Session.start', true); > > > Configure::write('Session.checkAgent', true); > > > > On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > > > > > hi stefan, > > > > > just a quick question cos I have just ran into this problem about an > > > > hour ago. > > > > > are you using the latest nightly or the 5875 release? Cos i'm having > > > > problems with the session not storing anything in the latest > > > > nightly... and going back to the pre-beta release fixed it. > > > > > I'm still looking into it- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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: Session problem ....
ok ... using lowercase functions read() and write() doesn't work, too ... :/ On 18 Dez., 12:29, hausburger <[EMAIL PROTECTED]> wrote: > hi everyone. just for your information: > - i tried database and cake as session storage (same problem) > - Configure::write('Security.level', 'medium'); > > the problem seems to be the cookie: > > - > NameCAKEPHP > Value dc5d17d748ce14a4a7fe6bcfebe5911c > Hostmy.domain.com > Path/ > Secure No > Expires Tue, 25 Dec 2007 11:11:12 GMT > - > NameCAKEPHP > Value b4bc42c1fe39d0b2b2a68dc431580ed7 > Hostmy.domain.com > Path/members/ > Secure No > Expires Fri, 17 Dec 2032 15:42:20 GMT > - > > 2 session cookies are stored. > > At the my.domain/members/ (this is the controller i set > user_login_data to session) the session_data is not accessable - but i > any other place like: > my.domain/ or my.domain/photos/ everything looks fine. > > ... > any idea? > > On 18 Dez., 12:13, stefuNz <[EMAIL PROTECTED]> wrote: > > > hi everyone, > > > thanks for all the replies! > > but nothing helped :( > > i'm using 1.2.0.5875 pre-beta > > and now i'm posting my core.php session settings, maybe i have > > something wrong here !? > > (when it's set to database, sometimes the database table is filled by > > some session stuff i guess .. but there are several records) > > > Configure::write('Session.save', 'database'); > > Configure::write('Session.table', 'cake_sessions'); // exists > > Configure::write('Session.database', 'default'); // set to default, so > > it automatically picks my database.php default database right?! > > Configure::write('Session.cookie', 'CAKEPHP'); > > Configure::write('Session.timeout', '3600'); > > Configure::write('Session.start', true); > > Configure::write('Session.checkAgent', true); > > > On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > > > > hi stefan, > > > > just a quick question cos I have just ran into this problem about an > > > hour ago. > > > > are you using the latest nightly or the 5875 release? Cos i'm having > > > problems with the session not storing anything in the latest > > > nightly... and going back to the pre-beta release fixed it. > > > > I'm still looking into it --~--~-~--~~~---~--~~ 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: Session problem ....
hi everyone. just for your information: - i tried database and cake as session storage (same problem) - Configure::write('Security.level', 'medium'); the problem seems to be the cookie: - NameCAKEPHP Value dc5d17d748ce14a4a7fe6bcfebe5911c Hostmy.domain.com Path/ Secure No Expires Tue, 25 Dec 2007 11:11:12 GMT - NameCAKEPHP Value b4bc42c1fe39d0b2b2a68dc431580ed7 Hostmy.domain.com Path/members/ Secure No Expires Fri, 17 Dec 2032 15:42:20 GMT - 2 session cookies are stored. At the my.domain/members/ (this is the controller i set user_login_data to session) the session_data is not accessable - but i any other place like: my.domain/ or my.domain/photos/ everything looks fine. ... any idea? On 18 Dez., 12:13, stefuNz <[EMAIL PROTECTED]> wrote: > hi everyone, > > thanks for all the replies! > but nothing helped :( > i'm using 1.2.0.5875 pre-beta > and now i'm posting my core.php session settings, maybe i have > something wrong here !? > (when it's set to database, sometimes the database table is filled by > some session stuff i guess .. but there are several records) > > Configure::write('Session.save', 'database'); > Configure::write('Session.table', 'cake_sessions'); // exists > Configure::write('Session.database', 'default'); // set to default, so > it automatically picks my database.php default database right?! > Configure::write('Session.cookie', 'CAKEPHP'); > Configure::write('Session.timeout', '3600'); > Configure::write('Session.start', true); > Configure::write('Session.checkAgent', true); > > On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > > > hi stefan, > > > just a quick question cos I have just ran into this problem about an > > hour ago. > > > are you using the latest nightly or the 5875 release? Cos i'm having > > problems with the session not storing anything in the latest > > nightly... and going back to the pre-beta release fixed it. > > > I'm still looking into it --~--~-~--~~~---~--~~ 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: Session problem ....
hi everyone, thanks for all the replies! but nothing helped :( i'm using 1.2.0.5875 pre-beta and now i'm posting my core.php session settings, maybe i have something wrong here !? (when it's set to database, sometimes the database table is filled by some session stuff i guess .. but there are several records) Configure::write('Session.save', 'database'); Configure::write('Session.table', 'cake_sessions'); // exists Configure::write('Session.database', 'default'); // set to default, so it automatically picks my database.php default database right?! Configure::write('Session.cookie', 'CAKEPHP'); Configure::write('Session.timeout', '3600'); Configure::write('Session.start', true); Configure::write('Session.checkAgent', true); On 18 Dez., 11:45, Dave J <[EMAIL PROTECTED]> wrote: > hi stefan, > > just a quick question cos I have just ran into this problem about an > hour ago. > > are you using the latest nightly or the 5875 release? Cos i'm having > problems with the session not storing anything in the latest > nightly... and going back to the pre-beta release fixed it. > > I'm still looking into it --~--~-~--~~~---~--~~ 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: Session problem ....
hi stefan, just a quick question cos I have just ran into this problem about an hour ago. are you using the latest nightly or the 5875 release? Cos i'm having problems with the session not storing anything in the latest nightly... and going back to the pre-beta release fixed it. I'm still looking into it --~--~-~--~~~---~--~~ 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: Session problem ....
Also, I'd be careful to use $this->Session->read() instead of $this- >Session-Read() (and write() instead of Write()). Those caps can be nasty.. --~--~-~--~~~---~--~~ 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: Session problem ....
Just a thought... Are all the settings in core.php appropriate? Do sessions work on you PHP set up, period? Are you saving to database or file? Are you file permissions setup correctly? -- Baz L Web Development 2.0: Web Design, CakePHP, Javascript http://www.WebDevelopment2.com/ On Dec 17, 2007 5:15 PM, stefuNz <[EMAIL PROTECTED]> wrote: > > Hi Baz! > > Thanks for your quick reply. > I just tested this and then i tested it with a normal string > 'test' ... but it didn't work. Here's the output of pr($this->session) > after trying to $this->session->read('test'); (btw. test is the name > of the variable AND the value .. quite confusing but nevermind :)) > > SessionComponent Object > ( >[__active] => 1 >[valid] => 1 >[error] => Array >( >[2] => test doesn't exist >[1] => Session is valid >) > >[_userAgent] => 97d3931cf333eb6077958dca0114c3f6 >[path] => /cake/ >[lastError] => 2 >[security] => high >[time] => 1197933144 >[sessionTime] => 1197969144 >[watchKeys] => Array >( >) > >[_log] => >[host] => localhost >[cookieLifeTime] => 0 > ) > > On 17 Dez., 23:59, Baz <[EMAIL PROTECTED]> wrote: > > You may want to take a look at this: > http://groups.google.com/group/cake-php/browse_thread/thread/a83a61b1... > > > > I've had problems with Cookies, which sound like your Session problems. > > -- > > Baz L > > Web Development 2.0http://WebDevelopment2.com/ > > > > On Dec 17, 2007 4:46 PM, stefuNz <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi.. > > > > > I use CakePHP 1.2 and i include the session component in $components = > > > array('Session'); > > > The Config is set up to store session information in my database. > > > Now i want to write a variable 'User', where User Information is > > > stored (as an array). > > > so i use $this->Session->Write('User',$array); > > > > > i can read the variable immediately after this command via $this- > > > >Session->Read('User'); > > > but i don't succeed in reading it in another action or even in the > > > same action at another time without writing it before... > > > > > Does anyone know how to fix that bug / error / by me ?! :) > > > > > cheers, > > > stefan > > > --~--~-~--~~~---~--~~ 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: Session problem ....
Hi Baz! Thanks for your quick reply. I just tested this and then i tested it with a normal string 'test' ... but it didn't work. Here's the output of pr($this->session) after trying to $this->session->read('test'); (btw. test is the name of the variable AND the value .. quite confusing but nevermind :)) SessionComponent Object ( [__active] => 1 [valid] => 1 [error] => Array ( [2] => test doesn't exist [1] => Session is valid ) [_userAgent] => 97d3931cf333eb6077958dca0114c3f6 [path] => /cake/ [lastError] => 2 [security] => high [time] => 1197933144 [sessionTime] => 1197969144 [watchKeys] => Array ( ) [_log] => [host] => localhost [cookieLifeTime] => 0 ) On 17 Dez., 23:59, Baz <[EMAIL PROTECTED]> wrote: > You may want to take a look at > this:http://groups.google.com/group/cake-php/browse_thread/thread/a83a61b1... > > I've had problems with Cookies, which sound like your Session problems. > -- > Baz L > Web Development 2.0http://WebDevelopment2.com/ > > On Dec 17, 2007 4:46 PM, stefuNz <[EMAIL PROTECTED]> wrote: > > > > > Hi.. > > > I use CakePHP 1.2 and i include the session component in $components = > > array('Session'); > > The Config is set up to store session information in my database. > > Now i want to write a variable 'User', where User Information is > > stored (as an array). > > so i use $this->Session->Write('User',$array); > > > i can read the variable immediately after this command via $this- > > >Session->Read('User'); > > but i don't succeed in reading it in another action or even in the > > same action at another time without writing it before... > > > Does anyone know how to fix that bug / error / by me ?! :) > > > cheers, > > stefan --~--~-~--~~~---~--~~ 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: Session problem ....
You may want to take a look at this: http://groups.google.com/group/cake-php/browse_thread/thread/a83a61b1d286c718/af60f3edf689eb58 I've had problems with Cookies, which sound like your Session problems. -- Baz L Web Development 2.0 http://WebDevelopment2.com/ On Dec 17, 2007 4:46 PM, stefuNz <[EMAIL PROTECTED]> wrote: > > Hi.. > > I use CakePHP 1.2 and i include the session component in $components = > array('Session'); > The Config is set up to store session information in my database. > Now i want to write a variable 'User', where User Information is > stored (as an array). > so i use $this->Session->Write('User',$array); > > i can read the variable immediately after this command via $this- > >Session->Read('User'); > but i don't succeed in reading it in another action or even in the > same action at another time without writing it before... > > Does anyone know how to fix that bug / error / by me ?! :) > > cheers, > stefan > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session problem ....
Hi.. I use CakePHP 1.2 and i include the session component in $components = array('Session'); The Config is set up to store session information in my database. Now i want to write a variable 'User', where User Information is stored (as an array). so i use $this->Session->Write('User',$array); i can read the variable immediately after this command via $this- >Session->Read('User'); but i don't succeed in reading it in another action or even in the same action at another time without writing it before... Does anyone know how to fix that bug / error / by me ?! :) cheers, stefan --~--~-~--~~~---~--~~ 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: Session problem in app_controller
I think you'll find that the $this->name is "Users", not "User". For our applications with simple authentication, I define another controller variable called $public_actions, which is an array of action names that do not need any authentication (as there are usually only a couple of these). So, in your UsersController have var $public_actions = array('login', 'logout'); and in your app_controller have function beforeFilter() { $public_action = true; if ( $this->name != 'Pages' && $this->name != 'App' ){ // all pages are public, 'App' is for missing model/view/controller errors if ( !isset($this->public_actions) or !is_array($this- >public_actions) or !in_array($this->action, $this->public_actions) ){ $this->checkSession(); } } } On Nov 2, 8:32 am, Anoop <[EMAIL PROTECTED]> wrote: > Hi > I have using the app_controller to redirect the request if the session > is not valid.But > the page isn't redirecting properly .Firefox has detected that the > server is redirecting the request for this address in a way that will > never complete. > if I comment the lines: > $this->redirect('/users/login'); > exit(); > That is also error if the page is currently /user/login... > > I think it can be tracked out if it is able to check the > controller.But how can I check the controller.I have checked like > > public function beforeFilter(){ > if($this->name !="User" || $this->name !="Pages") > $this->checkSession(); > } > But not working.Is there any way to do this by using the single > app_controller for every action for checking the session without > affecting the pages_controller and the user/login? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session problem in app_controller
Hi I have using the app_controller to redirect the request if the session is not valid.But the page isn't redirecting properly .Firefox has detected that the server is redirecting the request for this address in a way that will never complete. if I comment the lines: $this->redirect('/users/login'); exit(); That is also error if the page is currently /user/login... I think it can be tracked out if it is able to check the controller.But how can I check the controller.I have checked like public function beforeFilter(){ if($this->name !="User" || $this->name !="Pages") $this->checkSession(); } But not working.Is there any way to do this by using the single app_controller for every action for checking the session without affecting the pages_controller and the user/login? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session Problem
Hi, I'm new to CakePHP. I'm using WinXP, Apache 2.2, PHP 5 and CakePHP 1.2. I run into this problem about session. I can't retrieve the session when I redirect the user to another page like "/articles" after login except if it's on the same controller 'UsersController'. class UsersController extends AppController { var $name = "Users"; var $helpers = array("Html", "Form", "Countrylist"); function register() { $this->set('password_verification_error',''); if (!isset($this->user) || !$this->user) { if(!empty($this->data)) { $this->User->data = $this->data; if ($this->User->validates()) { if($this->data['User']['password'] != $this->data['User'] ['password2']) { $this->set('password_verification_error','Please verify your password again.The passwords specified do not match.'); } else { $this->data['User']['password'] = md5($this->data['User'] ['password']); $this->data['User']['last_login'] = date("Y-m-d H:i:s"); $this->data['User']['join_date'] = date("Y-m-d H:i:s"); $this->cleanUpFields(); $this->User->create(); if($this->User->save($this->data)) { $this->Session->write('user', $this->data['User']['email']); $this->redirect('/users/index'); } else { $this->flash("problem."); } } } else { $this->validateErrors($this->User); } } } else { $this->autoRender = false; $this->redirect("/"); } } function index() { $this->checkSession(); } function login() { $this->pageTitle = "iMallow - Author Login"; $this->set('error', ''); if ($this->data) { $results = $this->User->findByEmail($this->data['User']['email']); if ($results && $results['User']['password'] == md5($this- >data['User']['password'])) { $_SESSION['user'] = $this->data['User']['email']; $this->Session->write('user', $this->data['User']['email']); $this->Session->write('last_login', $results['User'] ['last_login']); $results['User']['last_login'] = date("Y-m-d H:i:s"); $this->User->save($results); $this->redirect('/articles'); } else { $this->set('error', 'Invalid login credential.'); } } } function logout() { $this->Session->delete('user'); $this->redirect('/users/login'); } } My ArticlesController looks like this: class ArticlesController extends AppController { var $name = "Articles"; function index() { $this->Session->renew(); } } I'm trying to get the session on my layout view which looks like this: http://www.w3.org/1999/xhtml";> meta('favicon.ico','/ favicon.ico',array('type'=>'icon')); ?> charset('utf-8'); ?> css('main','import'); ?> link($html->image("logo.gif", array("alt"=>"iMallow Articles", "boder"=>"0")),"/",false,false,false) ?> read('user')) { ?> Hi, read('user') ?>! link('My Account', '/users/profile') ?>, link('logout', '/users/logout') ?> Welcome Guest! link("Sign In","/users/login") ?> , link("Register Here","/users/register") ?> Submit An Article | Find Articles | Terms of Use | Privacy Policy | Contact Us Copyright © 2007. All rights reserved.
Re: Session problem in app_controller
This is because beforeFilter runs on all requests, including on /users/ login . So if you don't explicitly check for this (and any other pages where you don't need to be logged in to access), then it will see you are not logged in, and redirect you to /users/login. This is causing an infinite redirect loop. So make sure you check what the current controller and action are, and only redirect if it's somewhere the user must be logged in to access. --~--~-~--~~~---~--~~ 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: Session problem in app_controller
yeah!! that worked just fine! thanks however, now I'm getting another error by the browser: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. if I comment the lines: $this->redirect('/users/login'); exit(); everything is ok. On Oct 24, 2:18 pm, Gwoo <[EMAIL PROTECTED]> wrote: > You should look at the example in the Manual. It does not use > __construct(), it uses beforeFilter. The reason for this is the > components are not loaded in the constructor of the > Controller.http://manual.cakephp.org/appendix/simple_user_auth --~--~-~--~~~---~--~~ 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: Session problem in app_controller
You should look at the example in the Manual. It does not use __construct(), it uses beforeFilter. The reason for this is the components are not loaded in the constructor of the Controller. http://manual.cakephp.org/appendix/simple_user_auth --~--~-~--~~~---~--~~ 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: Session problem in app_controller
checkSession()) $this->layout = 'default'; else $this->layout = 'login'; } function checkSession() { // If the session info hasn't been set... if (!$this->Session->check('User')) { // Force the user to login $this->redirect('/users/login'); exit(); } } } ?> BTW, I'm just starting to learn cake, so sorry if some questions seem silly. On Oct 24, 2:01 pm, Matt Kosoy <[EMAIL PROTECTED]> wrote: > Post the code from your app controller so we can take a look. > > -m > > On Oct 24, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I'm using cake 1.1.17, and am following the Simple User Authentication > > example from the manual (http://manual.cakephp.org/appendix/ > > simple_user_auth), and I get the following error when I write the > > checkSession function in the app_controller.php file: > > > Notice: Undefined property: PagesController::$Session in /var/www/ > > cakestuff/clientes/app/app_controller.php on line 19 > > > Fatal error: Call to a member function check() on a non-object in /var/ > > www/cakestuff/clientes/app/app_controller.php on line 19 > > > Anyone know what I'm doing wrong?? I've google and asked on IRC, but > > nothing. > > > Thanks > > dave --~--~-~--~~~---~--~~ 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: Session problem in app_controller
No, but I just added var $components = array('session'); and the error continues. On Oct 24, 1:38 pm, dardosordi <[EMAIL PROTECTED]> wrote: > Are you using the session component? > > On Oct 24, 3:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I'm using cake 1.1.17, and am following the Simple User Authentication > > example from the manual (http://manual.cakephp.org/appendix/ > > simple_user_auth), and I get the following error when I write the > > checkSession function in the app_controller.php file: > > > Notice: Undefined property: PagesController::$Session in /var/www/ > > cakestuff/clientes/app/app_controller.php on line 19 > > > Fatal error: Call to a member function check() on a non-object in /var/ > > www/cakestuff/clientes/app/app_controller.php on line 19 > > > Anyone know what I'm doing wrong?? I've google and asked on IRC, but > > nothing. > > > Thanks > > dave --~--~-~--~~~---~--~~ 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: Session problem in app_controller
Post the code from your app controller so we can take a look. -m On Oct 24, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm using cake 1.1.17, and am following the Simple User Authentication > example from the manual (http://manual.cakephp.org/appendix/ > simple_user_auth), and I get the following error when I write the > checkSession function in the app_controller.php file: > > Notice: Undefined property: PagesController::$Session in /var/www/ > cakestuff/clientes/app/app_controller.php on line 19 > > Fatal error: Call to a member function check() on a non-object in /var/ > www/cakestuff/clientes/app/app_controller.php on line 19 > > Anyone know what I'm doing wrong?? I've google and asked on IRC, but > nothing. > > Thanks > dave --~--~-~--~~~---~--~~ 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: Session problem in app_controller
Are you using the session component? On Oct 24, 3:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm using cake 1.1.17, and am following the Simple User Authentication > example from the manual (http://manual.cakephp.org/appendix/ > simple_user_auth), and I get the following error when I write the > checkSession function in the app_controller.php file: > > Notice: Undefined property: PagesController::$Session in /var/www/ > cakestuff/clientes/app/app_controller.php on line 19 > > Fatal error: Call to a member function check() on a non-object in /var/ > www/cakestuff/clientes/app/app_controller.php on line 19 > > Anyone know what I'm doing wrong?? I've google and asked on IRC, but > nothing. > > Thanks > dave --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session problem in app_controller
I'm using cake 1.1.17, and am following the Simple User Authentication example from the manual (http://manual.cakephp.org/appendix/ simple_user_auth), and I get the following error when I write the checkSession function in the app_controller.php file: Notice: Undefined property: PagesController::$Session in /var/www/ cakestuff/clientes/app/app_controller.php on line 19 Fatal error: Call to a member function check() on a non-object in /var/ www/cakestuff/clientes/app/app_controller.php on line 19 Anyone know what I'm doing wrong?? I've google and asked on IRC, but nothing. Thanks dave --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
SwfUpload: session problem solved without cake core hack
When you use some Flash stuff that sends AJAX request then you loose your session id because Flash is not the same HTTP_USER_AGENT as your good browser. I discovered that trying to use SwfUpload (upload your files using AJAX with progressbar). I cannot send params directly due to security reasons. Also I don't like to change files from "cake" folder. Here is code that solves the problem. Insert in app/config/core.php after define('CAKE_SESSION_TIMEOUT', '3600'); === code begin === if (isset($_POST[CAKE_SESSION_COOKIE])) { session_name(CAKE_SESSION_COOKIE); session_id($_POST[CAKE_SESSION_COOKIE]); } session_start(); $_SESSION['Config']['userAgent'] = md5(env('HTTP_USER_AGENT') . CAKE_SESSION_STRING); === code end === I'm using http://swfupload.praxion.co.za/ version of SwfUpload. For the old SwfUpload you may need to change POST to GET. There could be security problem with Hijacking so it's better to check URL and apply this code only for the pages that need it. Dear gurus, please advise if there could be any other problems with security or Cake philosophy. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Hi, I looked at your code. 1. When you store datas into session you use $this->data, this is good but it don t contains the vars you are looking for. $this->data['Login'] is ok because it contains the data provided by the form. 2. The vars you are looking for are in the $results tab. Try : $this->Session->write('usertype',$results['Login'] ['login_type_id']); $this->Session->write('user_id',$results->data['Login']['user_id']); Let me know your results :) metasan http://www.piegteam.com --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Thank you all I got the answer from irc. Metasan said that the data is empty on filed login_type_id and user_id (because it came from the form thtml), so I have to use the $resuls variable not the data, this is my new code: $this->Session->write('user',$this->data['Login']['username']); $this->Session->write('usertype',$results['Login']['login_type_id']); $this->Session->write('user_id',$results['Login']['login_type_id']); $level=$this->Session->read('usertype'); --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Hi again. Sorry cause i just 2 days away. ErreUve I 'm also have try using your method.and this is my code: $this->Session->write('user',$this->data['Login']); $level=$this->Session->read('user.login_type_id'); if($level==1) { $this->redirect('/administrators/index'); exit(); } elseif ($level==2) { $this->redirect('/sales_records/index'); exit(); } else { $this->redirect('/company_records/index'); exit(); } } else { $this->set('error',true); } And it still didn't work. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Hi, I'm new with cakephp and I try to write all the User model in the session. Why is better serialize? Is there any problem with the data? The read and write works properly. Thanks --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
No, nevermind, I read what you were doing wrong. On 6/8/07, ErreUve <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm new with cakephp and I try to write all the User model in the > session. > Why is better serialize? Is there any problem with the data? The read > and write works properly. > > Thanks > > > > > --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
ErreUve, you're writing an array in session, I think you need to serialize it (check the php functions serialize and unserialize). On 6/8/07, ErreUve <[EMAIL PROTECTED]> wrote: > > > Hello all, > > I had the same problem. And I try wthis this: I put the 'User' in the > session and I read this at index.thml. > I've a WAMP and my login controller is like yours: > > function login() > { > // If a user has submitted form data: > if (!empty($this->data)) > { > $someone =$this->User->findByid($this->data['User']['id']); > if(!empty($someone['User']['password']) &&$someone['User'] > ['password'] == $this->data['User']['password']) > { > $this->Session->write('User', $someone['User']); > $this->redirect('users'); > } > // Else, they supplied incorrect data: > else > { > // Remember the $error var in the view? Let's set that to > true: > $this->set('error', true); > $this->redirect('users'); > } > } > } > > But the difference is in the index.thml (In Spanish, sorry) > Bienvenid@ > if (!$log) > { > echo "Registrate si quieres guardar tu historial de > ejercicios. > Gratis y fácil."; > } > else > { > //I read the 'User', who has 4 variables: id, intentos, aciertos > and > fallos. > $user=$session->read('User'); > echo $user['id']." has hecho ".$user['intentos']." > ejercicios con ". > $user['aciertos']." aciertos y ".$user['fallos']." fallos"; > > } > ?> > > > > > --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Hello all, I had the same problem. And I try wthis this: I put the 'User' in the session and I read this at index.thml. I've a WAMP and my login controller is like yours: function login() { // If a user has submitted form data: if (!empty($this->data)) { $someone =$this->User->findByid($this->data['User']['id']); if(!empty($someone['User']['password']) &&$someone['User'] ['password'] == $this->data['User']['password']) { $this->Session->write('User', $someone['User']); $this->redirect('users'); } // Else, they supplied incorrect data: else { // Remember the $error var in the view? Let's set that to true: $this->set('error', true); $this->redirect('users'); } } } But the difference is in the index.thml (In Spanish, sorry) Bienvenid@ read('User'); echo $user['id']." has hecho ".$user['intentos']." ejercicios con ". $user['aciertos']." aciertos y ".$user['fallos']." fallos"; } ?> --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Ok. I had already try the simple code about session, and now its work for code : But for my code in the first post (my first question), it still don't work. for you who don't remember my code: This is my code: function log_in() { $this->set('error',false); if($this->data) { $results=$this->Login->findByUsername($this- >data['Login'] ['username']); if($results && $results['Login']['password'] == md5($this- >data['Login']['password'])) { $this->Session->write('user',$this- >data['Login']['username']); $this->Session->write('usertype',$this- >data['Login'] ['login_type_id']); $this->Session->write('user_id',$this- >data['Login']['user_id']); $level=$this->Session- >read('usertype'); if($level==1) { $this->redirect('/ administrators/index'); exit(); } elseif ($level==2) { $this->redirect('/ sales_records/index'); exit(); } else { $this->redirect('/ company_records/index'); exit(); } } else { $this->set('error',true); } } } If i read the $user variable it give me the correct answer, but if i read the 2 and 3 variable ($usertype & $user_id) it didn't work. So my program didn't redirect. What's wrong? I also try to change my code : $level=$results['Login']['login_type_id']; and then i try to echo the session variable in the redirected view, it just give me the first one. this is the controller code on redirected function index() { //$username= //$level=$this->Session->read('usertype'); $this->set('level',$this->Session->read('user')); $this->set('User_Type',$this->Session- >read('usertype')); $this->set('User_Id',$this->Session->read('user_id')); } this is the code on index.thtml welcome link('logout','/login/logout') ?> and the result is: CakePHP Rapid Development welcome how do you do.lemune logout --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Ok. I will try. By the way WAMP that i think that you ask is WAMP installer that come from Roman Bourdon (Like php triad and XAMPP ). :-)) --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Refer to http://cakeforge.org/snippet/detail.php?type=snippet&id=189 This has the sessions section for php.ini. Your setup is commonly known as WAMP (Windows, Apache, MySQL, PHP) Compare with yours and adjust accordingly! On Jun 7, 9:30 pm, Lemune <[EMAIL PROTECTED]> wrote: > I use neither of both. > I use php-5.2.2-Win32, apache_2.2.4-win32-x86-no_ssl (Installer), > mysql-5.0.37-win32 (Installer), cake_1.1.15.5144, and > phpMyAdmin-2.10.0.2-english. > > Ketan Patel wrote: > > I will send you my php.ini once i get home. What is your setup? WAMP > > or LAMP? > > > Ketan > > > Lemune wrote: > > > Hello again. > > > I have tried your suggestion (Ketan Patel), and I don't see the > > > printout on 2nd visit. > > > Your suggestion is to fix it in php.ini. > > > I need help in this matters, because i don't know what is to be fix. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
I use neither of both. I use php-5.2.2-Win32, apache_2.2.4-win32-x86-no_ssl (Installer), mysql-5.0.37-win32 (Installer), cake_1.1.15.5144, and phpMyAdmin-2.10.0.2-english. Ketan Patel wrote: > I will send you my php.ini once i get home. What is your setup? WAMP > or LAMP? > > Ketan > > Lemune wrote: > > Hello again. > > I have tried your suggestion (Ketan Patel), and I don't see the > > printout on 2nd visit. > > Your suggestion is to fix it in php.ini. > > I need help in this matters, because i don't know what is to be fix. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
I will send you my php.ini once i get home. What is your setup? WAMP or LAMP? Ketan Lemune wrote: > Hello again. > I have tried your suggestion (Ketan Patel), and I don't see the > printout on 2nd visit. > Your suggestion is to fix it in php.ini. > I need help in this matters, because i don't know what is to be fix. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
Hello again. I have tried your suggestion (Ketan Patel), and I don't see the printout on 2nd visit. Your suggestion is to fix it in php.ini. I need help in this matters, because i don't know what is to be fix. --~--~-~--~~~---~--~~ 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: Session Problem for more than 1 variable
First try writing a small php script: create temp.php in your 'DocumentRoot' Directory of your server (check httpd.conf for this path). Save following code to temp.php: Visit http://localhost/temp.php two times. For 1st time, it will be all blank. For 2nd time, if you see the printout- Session Variable.. then your session is working OK and then start debugging with CakePHP. If you don't see the printout on 2nd visit, then there is a problem with your sessions in php.ini file. Fix this and your problem will be solved. I had similar problem and after 2 days of rigirous debugging found that the problem was with php.ini configuration file. So make sure above code works then try debugging in CakePHP. Also, I recommend you update your core.php in App/Config so that it uses 'database' for saving sessions. Ketan :-) Lemune wrote: > Hello all, > I'm just begin using the cakephp. > I'm trying to store 3 variable in session, but only the first one > that can be read. > This is my code: > function log_in() > { > $this->set('error',false); > > if($this->data) > { > > $results=$this->Login->findByUsername($this->data['Login'] > ['username']); > if($results && $results['Login']['password'] == > md5($this- > >data['Login']['password'])) > { > > $this->Session->write('user',$this->data['Login']['username']); > > $this->Session->write('usertype',$this->data['Login'] > ['login_type_id']); > > $this->Session->write('user_id',$this->data['Login']['user_id']); > $level=$this->Session->read('usertype'); > if($level==1) > { > > $this->redirect('/administrators/index'); > exit(); > } > elseif ($level==2) > { > $this->redirect('/sales_records/index'); > exit(); > } > else > { > > $this->redirect('/company_records/index'); > exit(); > } > } else { > $this->set('error',true); > } > > } > > } > > If i read the $user variable it give me the correct answer, but if i > read the 2 and 3 variable ($usertype & $user_id) it didn't work. So my > program didn't redirect. > What's wrong? > I also try to change my code : > $level=$results['Login']['login_type_id']; > > and then i try to echo the session variable in the redirected view, it > just give me the first one. > > this is the controller code on redirected > function index() > { > > //$username= > //$level=$this->Session->read('usertype'); > $this->set('level',$this->Session->read('user')); > $this->set('User_Type',$this->Session->read('usertype')); > $this->set('User_Id',$this->Session->read('user_id')); > } > this is the code on index.thtml > welcome > echo 'how do you do.'; > e($level); //for username > e($User_Type); //for usertype > e($User_Id); //for user id > ?> > > link('logout','/login/logout') ?> > > and the result is: > > > CakePHP Rapid Development > > welcome how do you do.lemune > > logout --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session Problem for more than 1 variable
Hello all, I'm just begin using the cakephp. I'm trying to store 3 variable in session, but only the first one that can be read. This is my code: function log_in() { $this->set('error',false); if($this->data) { $results=$this->Login->findByUsername($this->data['Login'] ['username']); if($results && $results['Login']['password'] == md5($this- >data['Login']['password'])) { $this->Session->write('user',$this->data['Login']['username']); $this->Session->write('usertype',$this->data['Login'] ['login_type_id']); $this->Session->write('user_id',$this->data['Login']['user_id']); $level=$this->Session->read('usertype'); if($level==1) { $this->redirect('/administrators/index'); exit(); } elseif ($level==2) { $this->redirect('/sales_records/index'); exit(); } else { $this->redirect('/company_records/index'); exit(); } } else { $this->set('error',true); } } } If i read the $user variable it give me the correct answer, but if i read the 2 and 3 variable ($usertype & $user_id) it didn't work. So my program didn't redirect. What's wrong? I also try to change my code : $level=$results['Login']['login_type_id']; and then i try to echo the session variable in the redirected view, it just give me the first one. this is the controller code on redirected function index() { //$username= //$level=$this->Session->read('usertype'); $this->set('level',$this->Session->read('user')); $this->set('User_Type',$this->Session->read('usertype')); $this->set('User_Id',$this->Session->read('user_id')); } this is the code on index.thtml welcome link('logout','/login/logout') ?> and the result is: CakePHP Rapid Development welcome how do you do.lemune logout --~--~-~--~~~---~--~~ 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: Scaffold & insert: session problem
Solved, I had validate_empty in id field :) thanks John! PS. There is no way to edit own post titles here? Would be nice habit to put some status marks to them (Solved: Scaffold & insert: session problem) On Apr 17, 12:08 am, John David Anderson <[EMAIL PROTECTED]> wrote: > On Apr 16, 2007, at 1:59 PM, bono wrote: > > > > > > > Lots of same kind of question but didn't find the answer. I have table > > like this: > > > CREATE TABLE 'users' ( > > 'id' INT( 10 ) NOT NULL AUTO_INCREMENT , > > 'username' VARCHAR( 40 ) NOT NULL , > > 'password' VARCHAR( 40 ) NOT NULL , > > 'email' VARCHAR( 255 ) NOT NULL , > > 'first_name' VARCHAR( 40 ) NOT NULL , > > 'last_name' VARCHAR( 40 ) NOT NULL , > > PRIMARY KEY ('id`), > > UNIQUE KEY 'username' ('username'), > > UNIQUE KEY 'email' ('email') > > ) TYPE = MYISAM ; > > > and I have "baked" default scaffold controller and view. When I try to > > add new user "Please correct errors below." error message is shown all > > the time even though all fields are correctly entered and no error > > messages are showing. > > > It comes from here (scaffold.php line 317): > > if (isset($this->controller->Session) && $this->controller->Session- > >> valid != false) { > > $this->controller->Session->setFlash(__('Please correct errors > > below.', true)); > > } > > > I have tried all three session saving methods buts it makes no > > difference. Environment is OS X 10.4.9, cakephp 1.2.0.4798alpha, php 5 > > and MySQL 5. > > > Any suggestions? > > Can you show us what your model looks like? > > You might want to comment out the validation rules in the model just > to see if that is what is causing the problems. > > -- John > > --~--~-~--~~~---~--~~ 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: Scaffold & insert: session problem
On Apr 16, 2007, at 1:59 PM, bono wrote: > > Lots of same kind of question but didn't find the answer. I have table > like this: > > CREATE TABLE 'users' ( > 'id' INT( 10 ) NOT NULL AUTO_INCREMENT , > 'username' VARCHAR( 40 ) NOT NULL , > 'password' VARCHAR( 40 ) NOT NULL , > 'email' VARCHAR( 255 ) NOT NULL , > 'first_name' VARCHAR( 40 ) NOT NULL , > 'last_name' VARCHAR( 40 ) NOT NULL , > PRIMARY KEY ('id`), > UNIQUE KEY 'username' ('username'), > UNIQUE KEY 'email' ('email') > ) TYPE = MYISAM ; > > and I have "baked" default scaffold controller and view. When I try to > add new user "Please correct errors below." error message is shown all > the time even though all fields are correctly entered and no error > messages are showing. > > It comes from here (scaffold.php line 317): > if (isset($this->controller->Session) && $this->controller->Session- >> valid != false) { > $this->controller->Session->setFlash(__('Please correct errors > below.', true)); > } > > I have tried all three session saving methods buts it makes no > difference. Environment is OS X 10.4.9, cakephp 1.2.0.4798alpha, php 5 > and MySQL 5. > > Any suggestions? Can you show us what your model looks like? You might want to comment out the validation rules in the model just to see if that is what is causing the problems. -- John > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Scaffold & insert: session problem
Lots of same kind of question but didn't find the answer. I have table like this: CREATE TABLE 'users' ( 'id' INT( 10 ) NOT NULL AUTO_INCREMENT , 'username' VARCHAR( 40 ) NOT NULL , 'password' VARCHAR( 40 ) NOT NULL , 'email' VARCHAR( 255 ) NOT NULL , 'first_name' VARCHAR( 40 ) NOT NULL , 'last_name' VARCHAR( 40 ) NOT NULL , PRIMARY KEY ('id`), UNIQUE KEY 'username' ('username'), UNIQUE KEY 'email' ('email') ) TYPE = MYISAM ; and I have "baked" default scaffold controller and view. When I try to add new user "Please correct errors below." error message is shown all the time even though all fields are correctly entered and no error messages are showing. It comes from here (scaffold.php line 317): if (isset($this->controller->Session) && $this->controller->Session- >valid != false) { $this->controller->Session->setFlash(__('Please correct errors below.', true)); } I have tried all three session saving methods buts it makes no difference. Environment is OS X 10.4.9, cakephp 1.2.0.4798alpha, php 5 and MySQL 5. Any suggestions? --~--~-~--~~~---~--~~ 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: kcaptcha session problem
Ok, turned out I was running into session race conditions. I temporarily solved the problem by switching the session handler to php. But, I still have a couple of questions, anyone care to explain? I'm writing directly into $_SESSION now. Q: Does this mean I can mix & match sessions? E.g. have 2 session stores, one accessed by $_SESSION, another by $this->Session? Or does CAKE_SESSION_SAVE override $_SESSION? Did anyone else run into race conditions using the Database session handler? Finally, is there some session locking mechanism provided in the Database handler? If not, could this be a new feature? Cheers - Francis On Feb 14, 10:57 am, "c1sc0" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm having a strange problem related tokcaptchaand sessions. > Basically I want to use multiple captchas per page, one for each form. > Obviously as each captcha loads separately, I'll overwrite my > 'captcha' session value. No problem there, I create different session > vars for each form, e.g. 'captcha_login', 'captcha_register', etc ... > On pages with one form/captcha : no problem, all values are written > correctly to session ... > > BUT: > > whenever I load multiple captchas on one page, sometimes not *all* > sessions are written, e.g. I expect 'captcha_login' and > 'captcha_register' to contain a value, yet only one of them does. > > Q: What could be a reason for $this->Session->write() *sometimes* not > working correctly? > > I hope this is clear, maybe later I can post some code. > > Cheers - Francis --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---