Re: Sessions Lost Oauth Debug Kit
On Tuesday, June 17, 2014 7:43:25 PM UTC+12, Justin Harrison wrote: Hi Cake 2.4 I have a very strange problem and I am lost even though I have been working with Cake a number of years. I have an app that I am integrating with XERO (An online accounting app) using OAuth. Xero provided sample code https://github.com/XeroAPI/XeroOAuth-PHP that works fine on my server. I messed with the sample code and using their libraries created the attached Controller. I have a dev area on my server and it works fine there. The user is directed to xero puts in their credentials and comes back with data from xero. Cool. Demo to client, All good. Copy to production. No worky:(. I eventually worked out that the test server has DebugKit and debug flag on but not in production notice in my controller I can turn debug on in line 8. It works but this is not a good solution. With debugging and DebugKit disabled the session is lost when it returns from the Xero server but with it enabled it does not!?!! Does anyone have any suggestions on where I can start looking? Any help appreciated. Solution ?! I found that adding var $components = array('Filter.Filter'); var $filters = array(); To the top of my ApiController class fixed it dont know how but it works now. I know that is not a neat solution but I'm out of time. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Sessions expiring when they should not
BTW, another problem of setting the cookie in 6 hours is that if the user has a clock that is not synced (i.e. more than 6 hours ahead), the browser will expire the session cookie and the user cannot stay logged in. Best, Chris On Tue, Sep 4, 2012 at 3:07 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: It looks like the code is in CakeSession.php I think I solved the cookie expiration problem with this in the core.php: Configure::write('Session', array( 'defaults' = 'php', 'cookieTimeout' = 0, //Lives until the browser is closed. 'checkAgent' = false //To fix a little the Chrome Frame problem )); Pretty much all main website manage the session expiration using a session cookie (that get removed when the browser is closed). Exceptions are website that keep you loggedin like Facebook. They set the cookie expiration to a month after login (but the user actually have to check the box - keep me logged in). I think though that setting by default the cookie expiration to 6h (I think it is the PHP session default) and NEVER updated it is a *BUG*. If the user is on the website for 6h, he should not be forced to logging again. This is a major problem if the user is writing some very long text into a page that save the text with Ajax calls.* * BTW, the default behavior can actually create more security problems that leave the cookie expire with the session. In fact if the user is on a public computer and close the browser to finish his/her session, the following user that connect before the 6h limit is going to be able to reconnect to the website under the previous user credentials.* *Best, Chris * * On Tue, Sep 4, 2012 at 12:19 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: Anybody that know at least what it is the expected behavior? Is it normal that the CAKEPHP cookie has 6h expiration after login and never get updated? Best, Chris On Fri, Aug 31, 2012 at 2:20 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: We are using CakePHP 2.2.1 on Ubuntu 12.04 but I notice this behavior also on my Mac running on XAMPP and as far as I know we have always had this problem. I would expect that: 1. The session expires if after a certain amount of time if there are no more calls to the server. 2. Activity on the server should update the expiring time. Instead we noticed that after a certain amount of time, the user get logged out and he has to log back in even if he accessed a page just a a minute before. I actually put even a hertbeat AJAX call that is been called every 20 minutes that was supposed to prevent the session to expire, but sessions keep getting lost. Is this the intended behavior? If it not I am not sure if the problem is on the frontend's cookie or the backend;s session. I noticed that the CAKEPHP cookie has 6h expiration time since I log in and it never get renewed. Best, Chris -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Sessions expiring when they should not
Anybody that know at least what it is the expected behavior? Is it normal that the CAKEPHP cookie has 6h expiration after login and never get updated? Best, Chris On Fri, Aug 31, 2012 at 2:20 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: We are using CakePHP 2.2.1 on Ubuntu 12.04 but I notice this behavior also on my Mac running on XAMPP and as far as I know we have always had this problem. I would expect that: 1. The session expires if after a certain amount of time if there are no more calls to the server. 2. Activity on the server should update the expiring time. Instead we noticed that after a certain amount of time, the user get logged out and he has to log back in even if he accessed a page just a a minute before. I actually put even a hertbeat AJAX call that is been called every 20 minutes that was supposed to prevent the session to expire, but sessions keep getting lost. Is this the intended behavior? If it not I am not sure if the problem is on the frontend's cookie or the backend;s session. I noticed that the CAKEPHP cookie has 6h expiration time since I log in and it never get renewed. Best, Chris -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Sessions expiring when they should not
It looks like the code is in CakeSession.php I think I solved the cookie expiration problem with this in the core.php: Configure::write('Session', array( 'defaults' = 'php', 'cookieTimeout' = 0, //Lives until the browser is closed. 'checkAgent' = false //To fix a little the Chrome Frame problem )); Pretty much all main website manage the session expiration using a session cookie (that get removed when the browser is closed). Exceptions are website that keep you loggedin like Facebook. They set the cookie expiration to a month after login (but the user actually have to check the box - keep me logged in). I think though that setting by default the cookie expiration to 6h (I think it is the PHP session default) and NEVER updated it is a *BUG*. If the user is on the website for 6h, he should not be forced to logging again. This is a major problem if the user is writing some very long text into a page that save the text with Ajax calls.* * BTW, the default behavior can actually create more security problems that leave the cookie expire with the session. In fact if the user is on a public computer and close the browser to finish his/her session, the following user that connect before the 6h limit is going to be able to reconnect to the website under the previous user credentials.* *Best, Chris* * On Tue, Sep 4, 2012 at 12:19 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: Anybody that know at least what it is the expected behavior? Is it normal that the CAKEPHP cookie has 6h expiration after login and never get updated? Best, Chris On Fri, Aug 31, 2012 at 2:20 PM, Chris Cinelli chris.cine...@formativelearning.com wrote: We are using CakePHP 2.2.1 on Ubuntu 12.04 but I notice this behavior also on my Mac running on XAMPP and as far as I know we have always had this problem. I would expect that: 1. The session expires if after a certain amount of time if there are no more calls to the server. 2. Activity on the server should update the expiring time. Instead we noticed that after a certain amount of time, the user get logged out and he has to log back in even if he accessed a page just a a minute before. I actually put even a hertbeat AJAX call that is been called every 20 minutes that was supposed to prevent the session to expire, but sessions keep getting lost. Is this the intended behavior? If it not I am not sure if the problem is on the frontend's cookie or the backend;s session. I noticed that the CAKEPHP cookie has 6h expiration time since I log in and it never get renewed. Best, Chris -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- --Everything should be made as simple as possible, but not simpler (Albert Einstein) -- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Sessions working on Local dev but not on server
I resolved the problem. Whatever the issue was it stopped when I updated the /cake folder on the server. On Oct 10, 10:22 pm, JTiki jeremyt...@gmail.com wrote: I've recently been working on a project for a client. Its a simple E- Commerce site and I decided to use Sessions for the cart. I got everything set-up and working 100% on my local dev area, but for some reason when I went over to the server the sessions are not carrying... I set-up a test under the action where I add items to the cart (/ mycart/add) and it is showing that the sessions are created and displays them correctly. However when refreshing the page, or going to a different page (like /mycart/) the session seems to be destroyed! I cannot figure this out... Can anyone help? I've set up an example below... Session just added and showing up:http://country.tikiwebproductions.com/mycart/add/2 Then move to another page and it disappears:http://country.tikiwebproductions.com/mycart/other -- 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: Sessions working on Local dev but not on server
Have you checked the db or filesystem if the session data is stored? You also have to have cookies enabled, othetwise the session cant be tracked. JTiki jeremyt...@gmail.com schrieb: I've recently been working on a project for a client. Its a simple E- Commerce site and I decided to use Sessions for the cart. I got everything set-up and working 100% on my local dev area, but for some reason when I went over to the server the sessions are not carrying... I set-up a test under the action where I add items to the cart (/ mycart/add) and it is showing that the sessions are created and displays them correctly. However when refreshing the page, or going to a different page (like /mycart/) the session seems to be destroyed! I cannot figure this out... Can anyone help? I've set up an example below... Session just added and showing up: http://country.tikiwebproductions.com/mycart/add/2 Then move to another page and it disappears: http://country.tikiwebproductions.com/mycart/other -- 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 -- 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: Sessions working on Local dev but not on server
How can i check? On Oct 11, 3:38 am, flo.kl...@googlemail.com flo.kl...@googlemail.com wrote: Have you checked the db or filesystem if the session data is stored? You also have to have cookies enabled, othetwise the session cant be tracked. JTiki jeremyt...@gmail.com schrieb: I've recently been working on a project for a client. Its a simple E- Commerce site and I decided to use Sessions for the cart. I got everything set-up and working 100% on my local dev area, but for some reason when I went over to the server the sessions are not carrying... I set-up a test under the action where I add items to the cart (/ mycart/add) and it is showing that the sessions are created and displays them correctly. However when refreshing the page, or going to a different page (like /mycart/) the session seems to be destroyed! I cannot figure this out... Can anyone help? I've set up an example below... Session just added and showing up:http://country.tikiwebproductions.com/mycart/add/2 Then move to another page and it disappears:http://country.tikiwebproductions.com/mycart/other -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Sessions Best Practice Question
Using the session data is fine, but no need to put it as a hidden field, in fact that's a bad idea as anyone could look at source and see the users id or worse change their user id value with FireBug and add items to another users account. Just inject the user_id into $this-data in the controller before saving. HTH, Paul @phpMagpie On Sep 18, 4:35 am, Media Affect themediaaff...@gmail.com wrote: I am trying to determine the best way to grab out the signed in user_id for adding items to another belongsto table. Is it ok to use the session data for this? I could easily use this as a hidden field in the form data. $session-read('Auth.User.id') ? But, does this belong in a controller? What is the best and most secure way to do this? I have a Users table with id, name and password I have a Authors table with id, user_id, address, city, state, zip Users won't be able to access each others account data. So after baking the app I would remove the User.name dropdown. -- 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: Sessions expiring with `Security.level` set to low and the `Session.timeout` set to 12000
There's not much info to go on here. Presumably you are using the Auth component and the user is logged in? If so, is the action she is trying to access allowed? Look in $this-Auth-allow in the controller (or app_controller is allowed actions have been set there). Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 30 Apr 2011, at 04:15, mattalexx wrote: My client is complaining that she posts a form and gets kicked to her login. I have the following code in `app/config/core.php`: Configure::write('Session.timeout', '12000'); Configure::write('Security.level', 'low'); Sessions should last 1,000 hours with these settings, right? So what else is going on? I realize that the client might be reporting the bug to me incorrectly and that there may be other factors involved, but I'm not even sure what to ask her about. -- 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 -- 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: Sessions expiring with `Security.level` set to low and the `Session.timeout` set to 12000
Have you set it so CakePHP controls your sessions? The default is PHP, and the session timeout is controlled in the PhP.ini for that one. It took me a long time to work this one out! On Apr 30, 4:15 am, mattalexx mattal...@gmail.com wrote: My client is complaining that she posts a form and gets kicked to her login. I have the following code in `app/config/core.php`: Configure::write('Session.timeout', '12000'); Configure::write('Security.level', 'low'); Sessions should last 1,000 hours with these settings, right? So what else is going on? I realize that the client might be reporting the bug to me incorrectly and that there may be other factors involved, but I'm not even sure what to ask her about. -- 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: Sessions and http/https
Thats another option, and by doing that you don't have to touch the core code, I will take a look at it before upgrading to 1.3.5... On 24 oct, 14:23, odd fihr87364hjkfhdjf6374hfz7z3h7...@trash- mail.com wrote: dtemes schrieb: I tryed with a custom save handler, but then i moved to database driver sessions, so finally I decided to touch the cake core code and set session.cookie_secure to 0, I am not really fond of this kind of solutions and would prefer a way to set it up from a config file without having to change the framework code. Not sure what you mean, when using a custom save handler you can simply copy the core code in there, and add the ini_set call that sets cookie_secure to 0. So when using database sessions copy the code in database switch case (cake_session.php, line 503) /// if (empty($_SESSION)) { if (Configure::read('Session.model') === null) { trigger_error(__(You must set the all Configure::write('Session.*') in core.php to use database storage), E_USER_WARNING); $this-_stop(); } if ($iniSet) { ini_set('session.use_trans_sid', 0); ini_set('url_rewriter.tags', ''); ini_set('session.save_handler', 'user'); ini_set('session.serialize_handler', 'php'); ini_set('session.use_cookies', 1); ini_set('session.name', Configure::read('Session.cookie')); ini_set('session.cookie_lifetime', $this-cookieLifeTime); ini_set('session.cookie_path', $this-path); ini_set('session.auto_start', 0); }} session_set_save_handler( array('CakeSession','__open'), array('CakeSession', '__close'), array('CakeSession', '__read'), array('CakeSession', '__write'), array('CakeSession', '__destroy'), array('CakeSession', '__gc') ); ini_set('session.cookie_secure', 0); /// Regards 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: Sessions and http/https
dtemes schrieb: I tryed with a custom save handler, but then i moved to database driver sessions, so finally I decided to touch the cake core code and set session.cookie_secure to 0, I am not really fond of this kind of solutions and would prefer a way to set it up from a config file without having to change the framework code. Not sure what you mean, when using a custom save handler you can simply copy the core code in there, and add the ini_set call that sets cookie_secure to 0. So when using database sessions copy the code in database switch case (cake_session.php, line 503) /// if (empty($_SESSION)) { if (Configure::read('Session.model') === null) { trigger_error(__(You must set the all Configure::write('Session.*') in core.php to use database storage), E_USER_WARNING); $this-_stop(); } if ($iniSet) { ini_set('session.use_trans_sid', 0); ini_set('url_rewriter.tags', ''); ini_set('session.save_handler', 'user'); ini_set('session.serialize_handler', 'php'); ini_set('session.use_cookies', 1); ini_set('session.name', Configure::read('Session.cookie')); ini_set('session.cookie_lifetime', $this-cookieLifeTime); ini_set('session.cookie_path', $this-path); ini_set('session.auto_start', 0); } } session_set_save_handler( array('CakeSession','__open'), array('CakeSession', '__close'), array('CakeSession', '__read'), array('CakeSession', '__write'), array('CakeSession', '__destroy'), array('CakeSession', '__gc') ); ini_set('session.cookie_secure', 0); /// Regards 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: Sessions and http/https
Maybe the session.cookie_secure option is set to true/1 by default in your PHP configuration (see php.ini), so uncommenting that line in cakes session class wont have any effect. Or maybe you have some PHP extension installed that automatically chooses to secure the cookie. Instead of uncommenting that line, try changing it to set the option to 0 and see if it makes any difference. If it works you'd probably better do that using a custom session save handler. Regards 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: Sessions and http/https
I tryed with a custom save handler, but then i moved to database driver sessions, so finally I decided to touch the cake core code and set session.cookie_secure to 0, I am not really fond of this kind of solutions and would prefer a way to set it up from a config file without having to change the framework code. On 23 oct, 12:03, odd fihr87364hjkfhdjf6374hfz7z3h7...@trash- mail.com wrote: Maybe the session.cookie_secure option is set to true/1 by default in your PHP configuration (see php.ini), so uncommenting that line in cakes session class wont have any effect. Or maybe you have some PHP extension installed that automatically chooses to secure the cookie. Instead of uncommenting that line, try changing it to set the option to 0 and see if it makes any difference. If it works you'd probably better do that using a custom session save handler. Regards 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: Sessions across multiple apps, same domain
Me too On Jul 1, 4:14 am, kevenages kevena...@gmail.com wrote: I'm fairly new to cake, but an experienced PHP developer. I have a production setup of cake. It looks as follows: /home/keven/cake1.3 - This contains the 'spark_plug' plugin, which handles authentication /home/keven/app1 /home/keven/app2 Webroot is located here: /var/www/login /var/www/contest /var/www/game The idea is that a user logs in, then goes to another app where their login details are supposed to be kept within session data or the $user object from spark plug plugin. The problem is that sessions are not being passed app to app. I've even tried to set a session explicitly in one app and tried to read it in another and it is blank. (ie, first app: $_SESSION['try'] = 'this' -- second app: print $_SESSION['try']; Any ideas would be greatly appreciated. Thanks in advance everyone More about my setup: Cake 1.3.2 Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'medium'); *** I've also tried 'low' Configure::write('Security.salt', 'LKJd2ou43kljLKDJfkljueoiru34asdfk3'); *** this is the same across all apps I've read the following articles to no avail: http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session...http://www.amityadav.name/cakephp-sharing-sessions-between-apps-on-th... 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: Sessions across multiple apps, same domain
hi how can i help you? On Mon, Jul 12, 2010 at 1:18 PM, sophy sophy.p...@gmail.com wrote: Me too On Jul 1, 4:14 am, kevenages kevena...@gmail.com wrote: I'm fairly new to cake, but an experienced PHP developer. I have a production setup of cake. It looks as follows: /home/keven/cake1.3 - This contains the 'spark_plug' plugin, which handles authentication /home/keven/app1 /home/keven/app2 Webroot is located here: /var/www/login /var/www/contest /var/www/game The idea is that a user logs in, then goes to another app where their login details are supposed to be kept within session data or the $user object from spark plug plugin. The problem is that sessions are not being passed app to app. I've even tried to set a session explicitly in one app and tried to read it in another and it is blank. (ie, first app: $_SESSION['try'] = 'this' -- second app: print $_SESSION['try']; Any ideas would be greatly appreciated. Thanks in advance everyone More about my setup: Cake 1.3.2 Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'medium'); *** I've also tried 'low' Configure::write('Security.salt', 'LKJd2ou43kljLKDJfkljueoiru34asdfk3'); *** this is the same across all apps I've read the following articles to no avail: http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session...http://www.amityadav.name/cakephp-sharing-sessions-between-apps-on-th. .. 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.comcake-php%2bunsubscr...@googlegroups.comFor 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: Sessions across multiple apps, same domain
hi u check this file core.php compare with ur core file On Mon, Jul 12, 2010 at 1:23 PM, Elavazhagan chidambaram azhagancod...@gmail.com wrote: hi how can i help you? On Mon, Jul 12, 2010 at 1:18 PM, sophy sophy.p...@gmail.com wrote: Me too On Jul 1, 4:14 am, kevenages kevena...@gmail.com wrote: I'm fairly new to cake, but an experienced PHP developer. I have a production setup of cake. It looks as follows: /home/keven/cake1.3 - This contains the 'spark_plug' plugin, which handles authentication /home/keven/app1 /home/keven/app2 Webroot is located here: /var/www/login /var/www/contest /var/www/game The idea is that a user logs in, then goes to another app where their login details are supposed to be kept within session data or the $user object from spark plug plugin. The problem is that sessions are not being passed app to app. I've even tried to set a session explicitly in one app and tried to read it in another and it is blank. (ie, first app: $_SESSION['try'] = 'this' -- second app: print $_SESSION['try']; Any ideas would be greatly appreciated. Thanks in advance everyone More about my setup: Cake 1.3.2 Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'medium'); *** I've also tried 'low' Configure::write('Security.salt', 'LKJd2ou43kljLKDJfkljueoiru34asdfk3'); *** this is the same across all apps I've read the following articles to no avail: http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session...http://www.amityadav.name/cakephp-sharing-sessions-between-apps-on-th. .. 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.comcake-php%2bunsubscr...@googlegroups.comFor 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 attachment: core.php
Re: Sessions across multiple apps, same domain
You should be using database sessions. On Jul 12, 12:57 am, Elavazhagan chidambaram azhagancod...@gmail.com wrote: hi u check this file core.php compare with ur core file On Mon, Jul 12, 2010 at 1:23 PM, Elavazhagan chidambaram azhagancod...@gmail.com wrote: hi how can i help you? On Mon, Jul 12, 2010 at 1:18 PM, sophy sophy.p...@gmail.com wrote: Me too On Jul 1, 4:14 am, kevenages kevena...@gmail.com wrote: I'm fairly new to cake, but an experienced PHP developer. I have a production setup of cake. It looks as follows: /home/keven/cake1.3 - This contains the 'spark_plug' plugin, which handles authentication /home/keven/app1 /home/keven/app2 Webroot is located here: /var/www/login /var/www/contest /var/www/game The idea is that a user logs in, then goes to another app where their login details are supposed to be kept within session data or the $user object from spark plug plugin. The problem is that sessions are not being passed app to app. I've even tried to set a session explicitly in one app and tried to read it in another and it is blank. (ie, first app: $_SESSION['try'] = 'this' -- second app: print $_SESSION['try']; Any ideas would be greatly appreciated. Thanks in advance everyone More about my setup: Cake 1.3.2 Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'medium'); *** I've also tried 'low' Configure::write('Security.salt', 'LKJd2ou43kljLKDJfkljueoiru34asdfk3'); *** this is the same across all apps I've read the following articles to no avail: http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en core.php 10KViewDownload 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: Sessions working in one controller and not the other
How do you have sessions configured. Are you using php, cake or database sessions? On May 4, 2:17 pm, LordZardeck s...@blackfireweb.com wrote: Adding still doesn't help. I REALLY need to figure this out. its so wierd because the sessions work when you add var $uses = array(), even when I don't have the Session componet added! its not even in the app_controller! On May 4, 10:42 am, thatsgreat2345 thatsgreat2...@gmail.com wrote: Not a clue, would have to look into the core for that. But either way just add var $components = array('Session'); to both of them. On May 3, 7:21 pm, LordZardeck s...@blackfireweb.com wrote: Ok, I found out that the problem arises when I use a model. When I set the $uses varibale to an empty array, it works. What would cause this? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswiththeir 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.organdhelpotherswith 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-Hidequotedtext - - Show quoted text - Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 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.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-Hide quoted
Re: Sessions working in one controller and not the other
I use php On May 5, 7:15 am, LunarDraco mdc...@gmail.com wrote: How do you have sessions configured. Are you using php, cake or database sessions? On May 4, 2:17 pm, LordZardeck s...@blackfireweb.com wrote: Adding still doesn't help. I REALLY need to figure this out. its so wierd because the sessions work when you add var $uses = array(), even when I don't have the Session componet added! its not even in the app_controller! On May 4, 10:42 am, thatsgreat2345 thatsgreat2...@gmail.com wrote: Not a clue, would have to look into the core for that. But either way just add var $components = array('Session'); to both of them. On May 3, 7:21 pm, LordZardeck s...@blackfireweb.com wrote: Ok, I found out that the problem arises when I use a model. When I set the $uses varibale to an empty array, it works. What would cause this? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswiththeirCakePHP 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.organdhelpotherswiththeir 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-Hidequotedtext- - Show quoted text - Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswith 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.organdhelpothers 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
Re: Sessions working in one controller and not the other
Not a clue, would have to look into the core for that. But either way just add var $components = array('Session'); to both of them. On May 3, 7:21 pm, LordZardeck s...@blackfireweb.com wrote: Ok, I found out that the problem arises when I use a model. When I set the $uses varibale to an empty array, it works. What would cause this? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 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.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-Hide quoted text - - Show quoted text - 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: Sessions working in one controller and not the other
Adding still doesn't help. I REALLY need to figure this out. its so wierd because the sessions work when you add var $uses = array(), even when I don't have the Session componet added! its not even in the app_controller! On May 4, 10:42 am, thatsgreat2345 thatsgreat2...@gmail.com wrote: Not a clue, would have to look into the core for that. But either way just add var $components = array('Session'); to both of them. On May 3, 7:21 pm, LordZardeck s...@blackfireweb.com wrote: Ok, I found out that the problem arises when I use a model. When I set the $uses varibale to an empty array, it works. What would cause this? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswith 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.organdhelpothers 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-Hidequoted text - - Show quoted text - 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- Hide quoted text - - Show quoted text - 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
Re: Sessions working in one controller and not the other
Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? 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: Sessions working in one controller and not the other
But the sessions controller works without it. Shouldn't the messages controller work without it also? I added it anyways, and it still didn't work. On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? 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- Hide quoted text - - Show quoted text - 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: Sessions working in one controller and not the other
Also, shouldn't there be an error if I try to use the Session component when it isn't included? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? 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- Hide quoted text - - Show quoted text - 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: Sessions working in one controller and not the other
Ok, I found out that the problem arises when I use a model. When I set the $uses varibale to an empty array, it works. What would cause this? On May 3, 6:21 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote: Include the session component On May 3, 3:59 pm, LordZardeck s...@blackfireweb.com wrote: For some reason, the session handling works in one controller and not the other. I can't figure out why. I am using CakePHP 1.2.5. // //Does work // sessions_controller.php: class SessionsController extends AppController { var $name = Sessions; var $layout = ajax; var $uses = array(); function create(){ if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); } } create.ctp: $msgJson[SessionID] = $SessionID; $msgJson[data] = $data; echo json_encode($msgJson); //results in ({SessionID:sd8s8o32edmjnjt94ouse99fd2,data:19409}) every time (parenthesis not in result) // //Doesn't Work // messages_controller.php: class MessagesController extends AppController { var $name = 'Messages'; var $layout = ajax; function listMessages() { if($this-Session-read('Data') == null){ $this-Session-write('Data', rand()); } $this-set('data', $this-Session-read('Data')); $this-set('SessionID', $this-Session-id()); $this-set('messages', $this-Message-find(all, array(order=priority ASC))); } } list_messages.ctp: $msgJson[count] = count($messages); $msgJson[SessionID] = $SessionID; $msgJson[SessionData] = $data; foreach($messages as $message){ $msg[] = $message[Message];} $msgJson[items] = $msg; echo json_encode($msgJson); /* results in ({count:3,SessionID:,SessionData:27384,items: [{id:4,priority:3,subject:Another message,message:adsfasdf}, {id:2,priority:3,subject:testing again,message:just seeing ow }, {id:7,priority:3,subject:asdgasdg,message:asdfasdfasd}]}) except the SessionData changes everytime and the SessionID never shows up. */ Any ideas what might be wrong? 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- Hide quoted text - - Show quoted text - 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: Sessions folder is getting huge
I think i use the cake one, you can see that in the core file right? (Configure::write('Session.save', 'cake'); ) Is changing that possible harmful for users on the site? On Apr 9, 10:04 pm, euromark dereurom...@googlemail.com wrote: do you use the php one? or the cake tmp/ one? because the first is usually garbige collected automatically, the cake session folder is not, though! On 9 Apr., 19:11, Miles J mileswjohn...@gmail.com wrote: Maybe you have a lot ofsessions? Try switching it to using a database. On Apr 9, 5:20 am, DeepJaguar goo...@jeffreydelange.nl wrote: Hi all, I have a problem with the tmp/sessionsfolder. For one of my sites the folder is 25GB already! What can be the problem? Best Regards, Jeffrey 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 To unsubscribe, reply using remove me as the subject.
Re: Sessions folder is getting huge
On Apr 15, 9:17 am, DeepJaguar goo...@jeffreydelange.nl wrote: I think i use the cake one, you can see that in the core file right? (Configure::write('Session.save', 'cake'); ) Yes, you can set that to php, cache, etc. Is changing that possible harmful for users on the site? The php setting tells Cake to use whatever PHP is configured for (eg. /tmp) while cake allows to save the files under your own app dir. The latter is somewhat safer in a shared hosting environment. 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 To unsubscribe, reply using remove me as the subject.
Re: Sessions folder is getting huge
Maybe you have a lot of sessions? Try switching it to using a database. On Apr 9, 5:20 am, DeepJaguar goo...@jeffreydelange.nl wrote: Hi all, I have a problem with the tmp/sessions folder. For one of my sites the folder is 25GB already! What can be the problem? Best Regards, Jeffrey 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 To unsubscribe, reply using remove me as the subject.
Re: Sessions folder is getting huge
do you use the php one? or the cake tmp/ one? because the first is usually garbige collected automatically, the cake session folder is not, though! On 9 Apr., 19:11, Miles J mileswjohn...@gmail.com wrote: Maybe you have a lot of sessions? Try switching it to using a database. On Apr 9, 5:20 am, DeepJaguar goo...@jeffreydelange.nl wrote: Hi all, I have a problem with the tmp/sessions folder. For one of my sites the folder is 25GB already! What can be the problem? Best Regards, Jeffrey 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 To unsubscribe, reply using remove me as the subject.
Re: Sessions table already in the database
Call your Session something else in your CakePHP application - but in your model, define that the model uses the table sessions, that should be the only place that the table sessions is used, thus hopefully not conflict with CakePHP. See http://book.cakephp.org/view/71/Model-Attributes#useTable-436 for the table definition. Enjoy, John On Dec 30, 4:44 pm, ecote ecote@gmail.com wrote: HI, Is there a way to change the default session handling? Reason: we have a database of events (conferences, speakers, attendees, etc... and, sadly, sessions !!). This database is used by some other applications so it would be difficult to change the table name. However, once the MVCs (thus the Session controller ) for this table are created, they cause total confusion to cakePHP !! What is the best workaround ? Sorry if it's a noob question... but can't find the answer anywhere ! Thanks ECote 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: Sessions and Redirect
Dear All I have same problem with LS, The Session didn't save anything when redirect, it means Auth didnt work!!, i think there is some configure nedeed but i dont know what, i was waste a week for this same problem... HELP!!! best regard --~--~-~--~~~---~--~~ 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: Sessions and Redirect
Try first retrieve your saved data from session in login action, then do login, and on success write your data back to session (maybe on fail too - don't know). Looks like session is re-created on login. On Aug 12, 5:03 am, LS lsmo...@gmail.com wrote: Er... Sorry, you're right. My code example was wrong, but using ?php $this-Session-check ('key') ? it also returns false. It creates two sessions (entries) in the database (cake_sessions). What i'm doing exactly: 1. User comes from an external site (eg. google.com) to an user- protected page (eg. mydomain.com/post/add) (user must login to access the page) 2. Cakephp stores the page the user wants to access in the session 3. User is redirected ?php $this-redirect('/users/login'); ? 4. User authenticates and returns to ?php $this-Session-read ('referer'); ? (note: if using ?php $this-referer() ? in this case, it returns the original off-site address (google.com), not the first address the user tried to reach (mydomain.com/post/add)). Still need help. Please? Thanks! On Aug 11, 11:52 am, Robert P shiftyrobs...@gmail.com wrote: In TwoController::bug() your call to SessionComponent seems nonsensical. Looking at what you are trying to do it should either be $this-Session-check('key') which should return TRUE since you set this value in OneController::start(), or ($this-Session-read('key') == 'info') which should also return TRUE for the above reason On Aug 11, 10:06 pm, LS lsmo...@gmail.com wrote: Hello, everyone. I'm into a dead end and I can't seem to get this session and redirect things right... I've tested this using cakephp, php and database session methods. I have two controllers and one action in each one, like this: ?php class OneController extends AppController { function start() { $this-Session-write('key', 'info'); $this-redirect('/two/bug'); // exit; // -- with or without this, I get the error. } (...) ? other file ?php class TwoController extends AppController { function bug() { if ($this-Session-check('info')) { // This never happens! echo(working); } } } ? When I check the database, I see two sessions, one with the info that was written on the controller one, and another one almost empty (only timeout and other info). I've even set the ?php Configure::write('Session.checkAgent', false); ? on the core.php file, but it still no good. Can someone enlight me, please? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions and Redirect
In TwoController::bug() your call to SessionComponent seems nonsensical. Looking at what you are trying to do it should either be $this-Session-check('key') which should return TRUE since you set this value in OneController::start(), or ($this-Session-read('key') == 'info') which should also return TRUE for the above reason On Aug 11, 10:06 pm, LS lsmo...@gmail.com wrote: Hello, everyone. I'm into a dead end and I can't seem to get this session and redirect things right... I've tested this using cakephp, php and database session methods. I have two controllers and one action in each one, like this: ?php class OneController extends AppController { function start() { $this-Session-write('key', 'info'); $this-redirect('/two/bug'); // exit; // -- with or without this, I get the error. } (...) ? other file ?php class TwoController extends AppController { function bug() { if ($this-Session-check('info')) { // This never happens! echo(working); } } } ? When I check the database, I see two sessions, one with the info that was written on the controller one, and another one almost empty (only timeout and other info). I've even set the ?php Configure::write('Session.checkAgent', false); ? on the core.php file, but it still no good. Can someone enlight me, please? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions and Redirect
Er... Sorry, you're right. My code example was wrong, but using ?php $this-Session-check ('key') ? it also returns false. It creates two sessions (entries) in the database (cake_sessions). What i'm doing exactly: 1. User comes from an external site (eg. google.com) to an user- protected page (eg. mydomain.com/post/add) (user must login to access the page) 2. Cakephp stores the page the user wants to access in the session 3. User is redirected ?php $this-redirect('/users/login'); ? 4. User authenticates and returns to ?php $this-Session-read ('referer'); ? (note: if using ?php $this-referer() ? in this case, it returns the original off-site address (google.com), not the first address the user tried to reach (mydomain.com/post/add)). Still need help. Please? Thanks! On Aug 11, 11:52 am, Robert P shiftyrobs...@gmail.com wrote: In TwoController::bug() your call to SessionComponent seems nonsensical. Looking at what you are trying to do it should either be $this-Session-check('key') which should return TRUE since you set this value in OneController::start(), or ($this-Session-read('key') == 'info') which should also return TRUE for the above reason On Aug 11, 10:06 pm, LS lsmo...@gmail.com wrote: Hello, everyone. I'm into a dead end and I can't seem to get this session and redirect things right... I've tested this using cakephp, php and database session methods. I have two controllers and one action in each one, like this: ?php class OneController extends AppController { function start() { $this-Session-write('key', 'info'); $this-redirect('/two/bug'); // exit; // -- with or without this, I get the error. } (...) ? other file ?php class TwoController extends AppController { function bug() { if ($this-Session-check('info')) { // This never happens! echo(working); } } } ? When I check the database, I see two sessions, one with the info that was written on the controller one, and another one almost empty (only timeout and other info). I've even set the ?php Configure::write('Session.checkAgent', false); ? on the core.php file, but it still no good. Can someone enlight me, please? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions in Components?
add var $components = array('Session') to your UploaderComponent --~--~-~--~~~---~--~~ 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: Sessions in Components?
Would it be possible if I took a look at your uploader? I recently just wrote one and am curious how others do it :p --~--~-~--~~~---~--~~ 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: Sessions in Components?
Worked great, should have tried it myself before asking! Cheers Sandie On Jun 9, 8:09 am, Gwoo gwoo.cake...@gmail.com wrote: add var $components = array('Session') to your UploaderComponent --~--~-~--~~~---~--~~ 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: Sessions lost
In the core.php there is this section: * The preferred session handling method. Valid values: * * 'php'Uses settings defined in your php.ini. * 'cake' Saves session files in CakePHP's /tmp directory. * 'database' Uses CakePHP's database sessions. * * To define a custom session handler, save it at /app/config/ name.php. * Set the value of 'Session.save' to name to utilize it in CakePHP. * * To use database sessions, execute the SQL file found at /app/config/ sql/sessions.sql. * */ Configure::write('Session.save', 'php'); By default, the sessions are handled by the php, so try to set it for cake: Configure::write('Session.save', 'cake'); and make sure the /tmp directory is writable. Or if you want to stick with the default, look for problems in your active php.ini file... On Apr 8, 4:16 pm, Dr. Loboto drlob...@gmail.com wrote: Set debug 0 and check for errors. Check session files store path to be writable by cake. On Apr 5, 11:32 pm, Deud'tens deudt...@gmail.com wrote: Hello, sorry for my english, I'm french. I have a god damn problem with sessions of cakephp : they don't work ! When I flash to another controller/action, everything is lost. I went into the core.php file and lowered everything possible and tried all the session handlers : Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'low'); etc. But it doesnt work. I already read many discussions about this problem but I couldnt solve it. This is a simple example of what I want to do : CODE ?php class UsersController extends AppController { function login() { if (!empty($this-data)) { $userId = $this-User-loginVerif($this-data); if ($userId != null) { $this-Session-write('Login.id', $userId); print_r($_SESSION);//Works fine $this-flash(Vous vous êtes authentifié avec succès., / quizzes/jouer); } } }} ? And the controller called by the previous action : CODE ?php class QuizzesController extends AppController { function jouer() { echo $this-Session-read('Login.id');//Totally empty ! $quiz = $this-Quiz-details(); $this-set('quiz', $quiz); }} ? I know that there's already an authcomponent, but it doesnt work, for the same reasons I guess. Thanks for all in advance !- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Sessions lost
Set debug 0 and check for errors. Check session files store path to be writable by cake. On Apr 5, 11:32 pm, Deud'tens deudt...@gmail.com wrote: Hello, sorry for my english, I'm french. I have a god damn problem with sessions of cakephp : they don't work ! When I flash to another controller/action, everything is lost. I went into the core.php file and lowered everything possible and tried all the session handlers : Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'low'); etc. But it doesnt work. I already read many discussions about this problem but I couldnt solve it. This is a simple example of what I want to do : CODE ?php class UsersController extends AppController { function login() { if (!empty($this-data)) { $userId = $this-User-loginVerif($this-data); if ($userId != null) { $this-Session-write('Login.id', $userId); print_r($_SESSION);//Works fine $this-flash(Vous vous êtes authentifié avec succès., / quizzes/jouer); } } }} ? And the controller called by the previous action : CODE ?php class QuizzesController extends AppController { function jouer() { echo $this-Session-read('Login.id');//Totally empty ! $quiz = $this-Quiz-details(); $this-set('quiz', $quiz); }} ? I know that there's already an authcomponent, but it doesnt work, for the same reasons I guess. Thanks for all 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions disappearing -- load balancing problem?
Are you using sticky sessions when balancing? (ask your system admin) Which session.save value are you using (php, database, cache)? (located on your core.php) Saludos, Pablo Viojo pvi...@gmail.com http://pviojo.net (#260 y creciendo!) Ayudar nos hace felices! http://needish.com - http://helperman.org On Fri, Mar 27, 2009 at 6:20 PM, Aimee ai...@neusolutions.com wrote: Hi, I've written an application that collects users' answers to questions using sessions. It works fine most of the time, but one of our users is having problems with sessions. The sessions seems to be set correctly in the controller, but once the next form is submitted, the sessions from before don't seem to exist anymore. It has been suggested that this might be caused by saving sessions based on IP, since we're using a load balancer. I'm not much of a server person, so I'm much in the know about the effects of load balancing on my code. Any thoughts or suggestions on why this might be happening or how to fix it? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions not writing whole string
Hi gkc, I am writing the user role to the the session with $this-Session-write('User.role',$this-$dbuser['User'] ['role']). Are you sure, that ,$this-$dbuser['User']['role'] is a string? Try like this: $this-Session-write('User.role', (string)$this-$dbuser['User'] ['role']); Hope that helps RoVo --~--~-~--~~~---~--~~ 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: Sessions, phpThumb, SwfUpload, Cake 1.2
Hey, If you are overwriting your $components variable for that controller, try adding in the Session component. I've got the feeling you'll want to do: var $components = array('Thumb', 'SwfUpload', 'Session'); Cheers, Graham On Mon, 12 Jan 2009 12:43:45 -0800 (PST), Parris presid...@parrisstudios.com wrote: Hi Everyone, So here is my issue. I have gotten the phpThumb and SWFupload components working. They upload, create thumbnails and using an ajax call will even post the thumbnails back on the page. There is an issue though. When I went back to only allow people logged in to upload pictures cake would drop my sessions. I tried many different things. I even deleted everything in the view, but my session still did not appear. Finally I decided to restore everything and simply delete: var $components = array('Thumb','SwfUpload'); Once this line was removed my sessions were working. However, at this point nothing else was. The other interesting thing is that the session would end with pages that didn't use either of these components (but use the same controller). Here are the important parts of my controller: (I tried using that before filter thing, but its pointless because my session ends in the component...,) ?php class GalleryPhotosController extends AppController { var $name = 'GalleryPhotos'; var $components = array('Thumb','SwfUpload'); var $helpers = array('Form','Javascript'); function beforeFilter() { if ($this-action == 'add'||$this-action == 'modify') { $this-Session-id($this-params['pass'][0]); $this-Session-start(); } parent::beforeFilter(); } function add($galleryCatId=0){ if ($this-requestAction('/members/isLoggedIn/')){ $memberId =$this-requestAction('/gallery_categories/findMemberId/'. $galleryCatId); if ($memberId==$this-Session-read('Member.id')){ $this-set('galleryCatId',$galleryCatId); $eventId =$this-requestAction('/gallery_categories/findEventId/'. $galleryCatId); $this-set('eventId',$eventId); $this-set('error',false); } else { $this-set('error',true); } } else { $this-set('error',true); } } function upload($galleryCatId,$sessionId,$overwrite=false){ if (isset($this-params['form']['Filedata'])) { // upload the file // use these to configure the upload path, web path, and overwrite settings if necessary $this-SwfUpload-uploadpath = 'fileupload'.DS. $galleryCatId.DS; $this-SwfUpload-webpath = '/fileupload/'. $galleryCatId.'/'; $this-SwfUpload-overwrite = $overwrite; //by default, SwfUploadComponent does NOT overwrite files // if ($this-SwfUpload-upload()) { $this-data['GalleryPhoto']['gallery_category_id'] = $galleryCatId; if (!($file = $this-GalleryPhoto-save($this-data))){ $this-Session-setFlash('Database save failed'); } else { $this-data['GalleryPhoto']['id'] = $this- GalleryPhoto-getLastInsertId(); $this-data['GalleryPhoto']['photo_caption'] = ; $this-data['GalleryPhoto']['photo_filename'] = $galleryCatId.DS.$this-SwfUpload-filename; $this-GalleryPhoto-save($this-data); if(!$this-Thumb-generateThumbnail($this-SwfUpload- uploadpath.$this-SwfUpload-filename,$this-SwfUpload- uploadpath.'tb_'.$this-SwfUpload-filename)){ pr($this-Thumb-errors); } } } else { $this-Session-setFlash($this-SwfUpload- errorMessage); } } } } ? I could also add the components they actually may be useful. I am sure most of you have them though. I didn't include the view because completely deleting everything from it had no effect. My security settings are medium, I have turned off checkUserAgent. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, phpThumb, SwfUpload, Cake 1.2
Graham, Thanks for the response; however, that did not fix the situation. I know the session is dead because when I look at the login area it tells me to log in. The strange thing is that when i go to a different page the session is alive again. It seems that the session just temporarily goes away whenever I include the phpThumb and swfupload components. I don't know why it would even happen with phpThumb. (yea I remove all components, and the session is alive. Leaving only swfupload or thumb will kill it, and yes normal components and other components do work. my captcha component works fine). I may try to use an iframe and just pass all the information into it, but that is causing more problems for sure. Plus it is rather hackish. --~--~-~--~~~---~--~~ 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: Sessions, phpThumb, SwfUpload, Cake 1.2
I am happy to report that the iframe work around did work; however, it did cause a significant amount of grief! There is a security hole now. I could solve it with some round about magic I suppose. Possibly manually creating some sort of checking mechanism. --~--~-~--~~~---~--~~ 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: Sessions lost due to .htaccess and AJAX
here is my directory structure: www.domain.com/ 1_00/ app/ views/ root/ login.thtml projects/ new.thtml If i create a Session variable in root controller, i cant see it outside. If i create a session variable outside of root, i can't see it in root. If I remember the htaccess, everything works. here is my htaccess: Options +FollowSymLinks -Indexes RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\.com$ RewriteRule (.*) http://www.domain.com [L] RewriteCond %{REQUEST_URI} !^(/1_00|/tools|/_clients|/_research|/wiki|/ blog) RewriteRule ^(.*)$ 1_00/$1 [L] On Oct 16, 3:35 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I moved the security to medium. I moved the method to 'database' I have a .htaccess that redirects everything fromwww.domain.comtowww.domain.com/1_00/ If I take the htaccess out, everything works. Otherwise, you can login but all AJAX request fails. AJAX request go towww.domain.com/controller/ajax/get will fail saying I dont have admin access because the $_SESSION is gone I have been working on this for hours and don't know what to do any more. please help. --~--~-~--~~~---~--~~ 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: Sessions lost due to .htaccess and AJAX
*If I remove the htaccess, everything works. On Oct 16, 6:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: here is my directory structure:www.domain.com/ 1_00/ app/ views/ root/ login.thtml projects/ new.thtml If i create a Session variable in root controller, i cant see it outside. If i create a session variable outside of root, i can't see it in root. If I remember the htaccess, everything works. here is my htaccess: Options +FollowSymLinks -Indexes RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\.com$ RewriteRule (.*)http://www.domain.com[L] RewriteCond %{REQUEST_URI} !^(/1_00|/tools|/_clients|/_research|/wiki|/ blog) RewriteRule ^(.*)$ 1_00/$1 [L] On Oct 16, 3:35 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I moved the security to medium. I moved the method to 'database' I have a .htaccess that redirects everything fromwww.domain.comtowww.domain.com/1_00/ If I take the htaccess out, everything works. Otherwise, you can login but all AJAX request fails. AJAX request go towww.domain.com/controller/ajax/get will fail saying I dont have admin access because the $_SESSION is gone I have been working on this for hours and don't know what to do any more. please help. --~--~-~--~~~---~--~~ 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: Sessions Weirdness
have you emptied the files (leaving folders) in the tmp dir? 2008/5/4 MikeK [EMAIL PROTECTED]: We used to have our cake app running in a subdir off our public_html called foo. So all cake paths were http://mysite.com/foo/controller/action/ We moved the app to the root directory and restructured the site to let everything else hang from the cake app's webroot. We just noticed suddenly some code that uses session vars is inexplicably no longer working. We have no hard-coded paths whatsoever. For example a controller sets a session var to remember the refering webpage. It is still instantiated in the view which is a form. WHen the form is submitted and we run back through the controller the session var of the original referring page is caput! ALso our email functions which pass set vars to templates stopped working. Can;t imagine what we did to make it mad - any advise is greatly appreciated. Dents in my head I have to call it a night. --~--~-~--~~~---~--~~ 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: sessions in cake php
On Feb 11, 7:52 am, abiram [EMAIL PROTECTED] wrote: Hi iam abi in my project sessions are not inserted in field what i do ? You could explain show code show an error message all of the above If nobody knows what you mean (and it's extremely unlikely with a 9 word description) they are unlikely to be able to help. AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
Hi Guys, This discussion has not been resolved yet. Could someone elaborate on the issue being experienced. For example, possible an reason why ajax sessions which are seen as bare === 1, cause the session not to start. Thanks, Greg On Jan 18, 12:04 pm, lordG [EMAIL PROTECTED] wrote: Could you elaborate on this? Which unrelated things? I traced the issue to the __start function of the Session Component. function __start(){ if ($this-__started === false) { if ($this-__bare === 0) { if (!$this-id() parent::start()) { $this-__started = true; parent::_checkValid(); } else { $this-__started = parent::start(); } } } return $this-__started; } It does not even look at starting the session or checking the useragent if the $params['bare'] is not 0. In my tests, Setting Configure::write('Session.checkAgent', false) did not change this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
Hi everyone, Just an update I deleted the php code at the beginning of default.ctp and it works. ugh... grainne On Jan 17, 2008 12:39 PM, BravoFoxtrot [EMAIL PROTECTED] wrote: I found the problem with my code using 1.2 beta. There was a destroy('Menu'); method that was called. The intent was to only delete part of the session that referred to the menu. I replaced this with delete('Menu'); and it works. I have no idea how this working in 1.2 pre beta but it did... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
http://au2.php.net/session_write_close The discussion here seems to indicate a PHP problem of some kind on some systems. or Some missing stuff in cake to garbage collect for all situations? or Well my problem seems to point elsewhere.. __start in setFlash? I encounter the problem with 1.2 + setFlash + redirect. However my old session data (set on previous writes) still exists. Anything set with Session-write works also, while the rest of the setFlash array is present also. Just the message is missing. $this-Session-setFlash('foobar'); $this-Session-write('foo','bar'); $this-redirect(array('controller'='users','action'='login'), null, true); Resulting debug of $_SESSION: [Message] = Array ( [flash] = Array ( [message] = [layout] = default [params] = Array ( ) ) ) [foo] = bar -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
debug(compact('message', 'layout', 'params')); Array ( [message] = foobar [layout] = default [params] = Array ( ) ) That's the debug from the compact that goes into the write inside setFlash. -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok I've been through it from top to bottom on the writing side of things, sessions, flash code etc. Seems that there is something cleaning up the message value before it gets to the session helper $session-flash(); Before the view (debug($_SESSION) at the top and no message). the message is deleted but everything else remains, even the flash related array. Then once $session-flash(); is called in the view the remaining flash array entries are cleaned up. -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok got it on my end.. Hopefully this can help some others. Problem is in the example code for DAuth user login controller. $this-DAuth-newSalt(); $this-Session-setFlash($error); This resets the message all the time with a blank var ($error is blank unless there has been one) Mod to something like this: $this-DAuth-newSalt(); if (!$this-Session-check('Message.flash') $error != '') { $this-Session-setFlash($error); } -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
Nate, Could you elaborate on this? On Jan 17, 5:42 pm, nate [EMAIL PROTECTED] wrote: Dude, you're confusing some very unrelated things. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
Could you elaborate on this? Which unrelated things? I traced the issue to the __start function of the Session Component. function __start(){ if ($this-__started === false) { if ($this-__bare === 0) { if (!$this-id() parent::start()) { $this-__started = true; parent::_checkValid(); } else { $this-__started = parent::start(); } } } return $this-__started; } It does not even look at starting the session or checking the useragent if the $params['bare'] is not 0. In my tests, Setting Configure::write('Session.checkAgent', false) did not change this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
On Jan 17, 2008 6:37 AM, lordG [EMAIL PROTECTED] wrote: Hi Guys, Does anyone know why the webservices or ajax calls have not been maintained across sessions? Will they be, or am I missing something? I believe this is related to previous discussions about the user agent being different for the Ajax calls. Try changing the following in in your config/core.php Configure::write('Session.checkAgent', true); to Configure::write('Session.checkAgent', false); and see if that helps your webservice and Ajax calls. Hope that helps, and I'm sure others will correct me if I'm wrong. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
I found the problem with my code using 1.2 beta. There was a destroy('Menu'); method that was called. The intent was to only delete part of the session that referred to the menu. I replaced this with delete('Menu'); and it works. I have no idea how this working in 1.2 pre beta but it did... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
Hi Guys, Does anyone know why the webservices or ajax calls have not been maintained across sessions? Will they be, or am I missing something? Thanks, Greg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
Hey Chris, Thanks for the input. I did review that, but could not find valid cause that it was that. The cake Route class if it finds that the url is Ajax, sets the $params['bare'] value to 1. As a result, the session component when checking if it should start the session checks if $params['bare'] = 0, if so it then starts. therefor any ajax session wont have session scope even if useragent is false. The only way for me to resolve this was to return the Route class to write $params['ajax'] = 1 if a ajax call is found, and then write adjust my own session class to check if the call was ajax too in order to keep the session scope. The other disadvantage here is that because the standard cake session class relies on $params['bare'] = 0, then all other webservices will also have no session scope. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
Has anyone else had this problem? Or more importantly, has anyone solved 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: sessions being dropped on redirect or whenever i call a new page
I've had session dropping problems with images and request action, I found setting your security level to low in /app/config/core.php will help. Upgrading to the 1.2 beta seemed to fix my problems at high security Dave On Jan 16, 7:36 am, BravoFoxtrot [EMAIL PROTECTED] wrote: Has anyone else had this problem? Or more importantly, has anyone solved 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: sessions being dropped on redirect or whenever i call a new page
I also have problems with this in 1.2 beta but I'm thinking it's because I'm setting the session from an ajax call, that's the last thing I've changed to see if it works. in 1.2 alpha it worked great, not it doesn't anymore :*( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
I have mine low and 1.2 beta - I have no ajax and no images. i think the only thing left for me to do is start over and slowly plug things back in. i promise though if i figure out what this is i'll post to the list. in solidarity, grainne On Jan 16, 2008 10:37 AM, alex.tomes [EMAIL PROTECTED] wrote: I also have problems with this in 1.2 beta but I'm thinking it's because I'm setting the session from an ajax call, that's the last thing I've changed to see if it works. in 1.2 alpha it worked great, not it doesn't anymore :*( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
I mean wouldn't On Jan 15, 11:05 am, lordG [EMAIL PROTECTED] wrote: Ok, yeah, the print_r would work as the session has not been started yet. However, there does appear to be a difference between when sessions start for normal requests and ajax requests. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok, yeah, the print_r would work as the session has not been started yet. However, there does appear to be a difference between when sessions start for normal requests and ajax requests. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Ok, traced it down to the bare variable and these lines in the session component: 00295 function __start(){ 00296 if ($this-__started === false) { 00297 if ($this-__bare === 0) { 00298 if (!$this-id() parent::start()) { 00299 $this-__started = true; 00300 parent::_checkValid(); 00301 } else { 00302 $this-__started = parent::start(); 00303 } 00304 } 00305 } 00306 return $this-__started; 00307 } Is this intended functionality? What if the call needs to maintain a session state, but is a bare = 1, like an ajax call? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Does anyone have any further suggestions on this? I cake 1.1 my ajax calls would work 100% with a session security set to medium. With Cake 1.2 however they are no longer working. It seems to have something to do with the $_SESSION array being undefined when the response is received. Shouldn't the $_SESSION have the correct information in it? I do a print_r($_SESSION) right at the beginning of the index.php file and I get the undefined error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
ok... does anyone know why the following the the router are being deprecated? 00503 /** 00504 * Deprecated 00505 * 00506 */ 00507 $_this-connect('/bare/:controller/:action/*', array('bare' = '1')); 00508 $_this-connect('/ajax/:controller/:action/*', array('bare' = '1')); I had to mod the ajax one to: 00508 $_this-connect('/ajax/:controller/:action/*', array('bare' = '1', 'ajax' = '1')); So that I could mod the sessionComponent to start the session if it was a ajax call. sessionComponent... lines 79 - 86: function initialize($controller) { if (isset($controller-params['bare'])) { $this-__bare = $controller-params['bare']; } if (isset($controller-params['ajax'])) { $this-__ajax = $controller-params['ajax']; } } lines 298 - 312: function __start(){ print_r($this-__webservice); if ($this-__started === false) { //if ($this-__bare === 0) { if ($this-__bare === 0 || ($this-__ajax == 1 $this-__bare === 1)) { if (!$this-id() parent::start()) { $this-__started = true; parent::_checkValid(); } else { $this-__started = parent::start(); } } } return $this-__started; } What are webserivce ones becoming and will session state be maintainable with webservices and ajax? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
Hey Chris, yeah I had a similar problem before with 1.1 and did then and now downscaled the security to medium. What is the difference between the 3 levels though, other than the timeout scale time? Chris Hartjes wrote: On Jan 13, 2008 6:24 PM, lordG [EMAIL PROTECTED] wrote: Hi guys, I'm experiencing a problem with the redirects when I destroy the session, set a flash message and then redirect. When it gets to the redirect page, the flash no longer exists and the session is clean of any custom session data they may have been set after the destroy call. Does the redirect do anything with regards to the Sessions if they have been just been destroy'd and renew'd? I noticed the session_write_close call, but that just locks the session and shouldn't affect the session data. Very weird. G First thing to check when sessions go haywire is your security level in config/copre.php. Make sure it's set to low, as on high it regenerates the session on every refresh (or so I remember being told). Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
Are you using IE? It silently drops the session if the hostname contains an underscore took me ages to find out why project_beta.domain.com wouldn't work ... wirtsi On 13 Jan., 15:50, Grainne [EMAIL PROTECTED] wrote: Hi, Hope you are all having enjoyable weekends... I'm certain I'm missing something obvious - but I have spent days trying to figure out what - so I thought I'd ask. My sessions are being dropped when or if I just go to a new page. I am using beta 1.2 I checked for whitespace outside of my models and controllers. My security is set to low. I have tried using cake,php, and database. I looked for session start in my vendor files - or really anywhere. I have tried it with debug set to 0-3. Thank you so much, in advance. I really apprecate it! - Grainne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
there was a ticket about session regenerated for img in the page I didn't remind if it was fixed before or after the beta maybe you should try with a newer SVN code but as precedent advice said, check before if there's undescore in your localhost or subdomain. On 14 jan, 12:43, wirtsi [EMAIL PROTECTED] wrote: Are you using IE? It silently drops the session if the hostname contains an underscore took me ages to find out why project_beta.domain.com wouldn't work ... wirtsi On 13 Jan., 15:50, Grainne [EMAIL PROTECTED] wrote: Hi, Hope you are all having enjoyable weekends... I'm certain I'm missing something obvious - but I have spent days trying to figure out what - so I thought I'd ask. My sessions are being dropped when or if I just go to a new page. I am using beta 1.2 I checked for whitespace outside of my models and controllers. My security is set to low. I have tried using cake,php, and database. I looked for session start in my vendor files - or really anywhere. I have tried it with debug set to 0-3. Thank you so much, in advance. I really apprecate it! - Grainne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
Great tip. I was search for an answer also. Tks, Cristian On Jan 14, 3:09 pm, djiize [EMAIL PROTECTED] wrote: there was a ticket about session regenerated for img in the page I didn't remind if it was fixed before or after the beta maybe you should try with a newer SVN code but as precedent advice said, check before if there's undescore in your localhost or subdomain. On 14 jan, 12:43, wirtsi [EMAIL PROTECTED] wrote: Are you using IE? It silently drops the session if the hostname contains an underscore took me ages to find out why project_beta.domain.com wouldn't work ... wirtsi On 13 Jan., 15:50, Grainne [EMAIL PROTECTED] wrote: Hi, Hope you are all having enjoyable weekends... I'm certain I'm missing something obvious - but I have spent days trying to figure out what - so I thought I'd ask. My sessions are being dropped when or if I just go to a new page. I am using beta 1.2 I checked for whitespace outside of my models and controllers. My security is set to low. I have tried using cake,php, and database. I looked for session start in my vendor files - or really anywhere. I have tried it with debug set to 0-3. Thank you so much, in advance. I really apprecate it! - Grainne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions being dropped on redirect or whenever i call a new page
thanks so much for your help no underscore - i'm using firefox on windows/apache i think might try the latest code and slowly putting elements of my project in until it works/doesn't work That underscore was a great tip though. grainne On Jan 14, 2008 10:04 AM, candesprojects [EMAIL PROTECTED] wrote: Great tip. I was search for an answer also. Tks, Cristian On Jan 14, 3:09 pm, djiize [EMAIL PROTECTED] wrote: there was a ticket about session regenerated for img in the page I didn't remind if it was fixed before or after the beta maybe you should try with a newer SVN code but as precedent advice said, check before if there's undescore in your localhost or subdomain. On 14 jan, 12:43, wirtsi [EMAIL PROTECTED] wrote: Are you using IE? It silently drops the session if the hostname contains an underscore took me ages to find out why project_beta.domain.com wouldn't work ... wirtsi On 13 Jan., 15:50, Grainne [EMAIL PROTECTED] wrote: Hi, Hope you are all having enjoyable weekends... I'm certain I'm missing something obvious - but I have spent days trying to figure out what - so I thought I'd ask. My sessions are being dropped when or if I just go to a new page. I am using beta 1.2 I checked for whitespace outside of my models and controllers. My security is set to low. I have tried using cake,php, and database. I looked for session start in my vendor files - or really anywhere. I have tried it with debug set to 0-3. Thank you so much, in advance. I really apprecate it! - Grainne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
i'm having the same problem. (except minus the flash) ugh... On Jan 13, 2008 5:24 PM, lordG [EMAIL PROTECTED] wrote: Hi guys, I'm experiencing a problem with the redirects when I destroy the session, set a flash message and then redirect. When it gets to the redirect page, the flash no longer exists and the session is clean of any custom session data they may have been set after the destroy call. Does the redirect do anything with regards to the Sessions if they have been just been destroy'd and renew'd? I noticed the session_write_close call, but that just locks the session and shouldn't affect the session data. Very weird. G --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
On Jan 13, 2008 6:24 PM, lordG [EMAIL PROTECTED] wrote: Hi guys, I'm experiencing a problem with the redirects when I destroy the session, set a flash message and then redirect. When it gets to the redirect page, the flash no longer exists and the session is clean of any custom session data they may have been set after the destroy call. Does the redirect do anything with regards to the Sessions if they have been just been destroy'd and renew'd? I noticed the session_write_close call, but that just locks the session and shouldn't affect the session data. Very weird. G First thing to check when sessions go haywire is your security level in config/copre.php. Make sure it's set to low, as on high it regenerates the session on every refresh (or so I remember being told). Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote: Hi Chris, The debug is set to 2. The set up is WAMP where I experience this issue. However, just to make sure that this happens on Linux box or not, I booted into Linux and it works fine in linux. So I don't know if its CakePHP issue or its WAMP configuration issue. Let me know. Sorry, no experience with WAMP at this end. I don't know of any tried-and-true methods of debugging sessions. There must be other people from the WAMP crowd on this list who can help you out. Good to see that debug is set to 2. First step is to get as much information as possible. :) -- Chris Hartjes My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
I had an issue like that with WAMP, it was due to an underscore in the subdomains and the session didn't fix. Maybe not your case, but I must told you in case of ;) On 30 mai, 14:51, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote: Hi Chris, The debug is set to 2. The set up is WAMP where I experience this issue. However, just to make sure that this happens on Linux box or not, I booted into Linux and it works fine in linux. So I don't know if its CakePHP issue or its WAMP configuration issue. Let me know. Sorry, no experience with WAMP at this end. I don't know of any tried-and-true methods of debugging sessions. There must be other people from the WAMP crowd on this list who can help you out. Good to see that debug is set to 2. First step is to get as much information as possible. :) -- Chris Hartjes My motto for 2007: Just build it, damnit! @TheBallpark -http://www.littlehart.net/attheballpark @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote: When the form is posted, in expected input, I am not able to see the session variable alpha which I had set during the intial view. Can someone point me in right direction what's wrong? I know that session variable is set because when I look into database for session entry, I do see the variable 'alpha' declared as 15 in the data column. But somehow it is not shown when the form is posted or read is requested! I keep saying to myself people read the manual, Chris, they really do. What debug level do you have your application set to? If it's 0 then you are probably seeing cached data. -- Chris Hartjes My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
Hi Chris, The debug is set to 2. The set up is WAMP where I experience this issue. However, just to make sure that this happens on Linux box or not, I booted into Linux and it works fine in linux. So I don't know if its CakePHP issue or its WAMP configuration issue. Let me know. Ketan On May 29, 10:07 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote: When the form is posted, in expected input, I am not able to see the session variable alpha which I had set during the intial view. Can someone point me in right direction what's wrong? I know that session variable is set because when I look into database for session entry, I do see the variable 'alpha' declared as 15 in the data column. But somehow it is not shown when the form is posted or read is requested! I keep saying to myself people read the manual, Chris, they really do. What debug level do you have your application set to? If it's 0 then you are probably seeing cached data. -- Chris Hartjes My motto for 2007: Just build it, damnit! @TheBallpark -http://www.littlehart.net/attheballpark @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions on production server with cookies disabled
Well, I'll answer my question... Since I didn't want to hack the core files, i put this in my app_controller: function redirect($url, $status = null, $exit = false) { if (!empty($_REQUEST[CAKE_SESSION_COOKIE])) { $url .= (strpos($url, '?') !== false) ? 'amp;':'?'; $url .= CAKE_SESSION_COOKIE . '=' . $_REQUEST[CAKE_SESSION_COOKIE]; } parent::redirect($url, $status, $exit); } Seems to work. Thx anyway, have a nice day, f. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions not carying over?
Ok this is my login page: /admin/index.php/users/login When I redirect to: /admin/index.php/users/index I can print the session onscreen, so this means its working. But the moment I goto /admin/ The root of the site then the session does not appear. Anybody got a solution for this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions not carying over?
I finally got it working. Cakephp was deleting my session everytime I went to login page somehow. I dont have delete session in the controller class UsersController extends AppController { var $name = 'Users'; var $scaffold; function index() { } function login() { $error = false; $success = false; if (!empty($this-data)) { $someone = $this-User-findByUsername($this- params['data']['User']['username']); if(is_array($someone)) { if(md5($this-data['User']['password']) == $someone['User']['password']) { $success = true; } } if($success) { $this-Session-write('User', $someone['User']); $this-redirect('/hunters/index'); return true; } else { $this-Session-setFlash(Login Failed); } } $this-set('error', $error); } function logout() { $this-Session-delete('User'); $this-Session-setFlash('Logged out'); $this-redirect('/'); return true; } } Does Cakephp preload functions or something? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions not carying over?
Ok here is my problem. This is my login controller: if($success) { $this-Session-write('User', $someone['User']); $test = $this-Session-check('User'); $this-Session-setFlash(bs $test); //$this-redirect('../'); return true; } This flash bs 1 Here is where I redirect function index() { $test = $this-Session-check('User'); $this-Session-setFlash(bs $test); } this bs So it does not keep the session when I redirect I call this in my components var $components = array ('Pagination','Mailer','PhpGacl','Session'); // Added Is it maybe cause Im going down a directory? $this-redirect('../'); Im new to cakephp and would just like this simple login form to work. I can do this in 5 minutes without capkephp. L --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in database
or $result = eval(return \$_SESSION;); pr($result); On Apr 4, 11:49 am, jyrgen [EMAIL PROTECTED] wrote: here's a solution i found on php.net. it's definitely not smart, but works ok. $temp = mysql_query('SELECT * FROM sessions'); while ($row = mysql_fetch_array($temp)){ $variables = array( ); $a = preg_split( /(\w+)\|/, $row['data'], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for( $i = 0; $i count( $a ); $i = $i+2 ) { $variables[$a[$i]] = unserialize( $a[$i+1] ); } } pr($variables); cheers, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in database
here's a solution i found on php.net. it's definitely not smart, but works ok. $temp = mysql_query('SELECT * FROM sessions'); while ($row = mysql_fetch_array($temp)){ $variables = array( ); $a = preg_split( /(\w+)\|/, $row['data'], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for( $i = 0; $i count( $a ); $i = $i+2 ) { $variables[$a[$i]] = unserialize( $a[$i+1] ); } } pr($variables); cheers, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions
Perhaps I should explain more. I have index.php outputting the session id at the end with this code: echo session id is .session_id(); Before I log in I can call up different screens and the session id stays the same. Then I log in and the session id is still the same, but I when I go to a different screen the session id has changed (and I lose my session data). I have tried using php sessions, cake sessions, database sessions and a method I found suggested for creating your own session handling in this thread, http://groups.google.com/group/cake-php/browse_frm/thread/ada15abbf3507645/20468b698214128f I had problems which then vanished, but they have returned. I did not change the configuration between the time they worked and the time my problems returned. I did bake some controllers and views and write some code. This is driving me crazy because I need sessions working to test my work, and I don't know what else to try. I have confirmed that sessions seem to be being written. The cookie for the session id exists and it's value keeps changing. On 04/04/07, Olwen Williams [EMAIL PROTECTED] wrote: Like other people I have had problems with sessions. I have tried various solutions that have been suggested on the list, and the session id keeps changing (out putting the session id at the end of index.php). It did start working, but has now stopped again. I have not changed (consciously) changed any configuration in the meantime. In the interim I have created some controllers and views. (using bake.php). I am using php sessions which work generally on my development server. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in database
There is $db-value(time()) wich fetch value from data field in session table... from libs/session.php: $db = ConnectionManager::getDataSource('default'); $table = $db-fullTableName(CAKE_SESSION_TABLE); $db-execute(DELETE FROM . $db-name($table) . WHERE . $db- name($table.'.expires') . . $db-value(time())); Can U use this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in database
Hi Majna, it's not that i want to check for expiration, but rather if a user is already logged in. (see above) i cannot simply test for sth. like $this-Session-read('logged_in') because this refers to the current session, which i am just about to construct... therefore i had to search all existing session entries in the db for a userID and the logged_in flag. the code i posted is ugly, i looked at /lib/session.php twice but i was not able to determine how cake unserializes the session vars. still i'm looking for a better solution. regards, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in cake db _gc
hello all, can anybody help please ? thanks, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in cake db _gc
hi, thanks for pointing my to this, you're right, there seems to be no solution. i wouldn't mind writing a custom handler, which erases expired session entries. but i need something to start with... still i'm confused about the fact, that the cake session handling behaves different on different machines. As i stated above the internal _gc function appears to be called correctly on my local machine. hm.. probably there's some more stuff going on behind the scenes, which might depend on the the php version or settings respectively. cheers, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in cake db _gc
Hi, i've set this define('CAKE_SESSION_SAVE', 'database'); in app/config/core.php (there is no file config.php in app/config/ ) , which made me believe that the entirely session handling is leftover to cake. the oldest session is almost two weeks old... but never on my local server ...strange... J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in cake db _gc
There is thread : http://groups.google.com/group/cake-php/browse_thread/thread/2a6120727e5e7745/5718c2fec805b063?lnk=gstq=sessionrnum=6#5718c2fec805b063 read this, i have same problem, but there is no solution. :( is it cake bug? On Mar 23, 12:18 pm, jyrgen [EMAIL PROTECTED] wrote: Hi, i've set this define('CAKE_SESSION_SAVE', 'database'); in app/config/core.php (there is no file config.php in app/config/ ) , which made me believe that the entirelysession handling is leftover to cake. the oldestsessionis almost two weeks old... but never on my local server ...strange... J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions in cake db _gc
jyrgen [EMAIL PROTECTED] wrote: on my local machine i find that expired session entries are deleted automatically. on a remote webserver there are more than 40 entries.. possibly the cake garbage collection is not being called. 40 entries is bad? Are they old? What are the timestamps? I'm not sure this is a problem. If it helps, Cake defaults to using PHP's way of handling sessions -- to see which you are using, see CAKE_SESSION_SAVE in $(APP)/config/config.php. Of course, if you have this set to php, then please poke your PHP configuration to fix this. Kind regards, -- Chris Lamb, Leamington Spa, UKGPG: 0x634F9A20 signature.asc Description: PGP signature
Re: sessions problem
Hello, That particular define controls ao CAKE handles sessions...you have 3 choices: * php - CAKE uses PHP Session to store Session Data * database - CAKE uses DB to store Session Data * cake - CAKE uses a temp file to store Session Data So, I think that NOT TELLING cake how you want it to handle the Sessions is not a good ideia... You really should pick an option from above and try it to make it work, because you cannot tell how cake will behave if nothing is defined as the place-holder for session data... Good luck! On Mar 7, 3:34 pm, jamiro [EMAIL PROTECTED] wrote: In my case my solution was: define('CAKE_SESSION_SAVE', ''); Is a good solution? thanks. On 7 mar, 03:52, bingo [EMAIL PROTECTED] wrote: Hi mindcharger, Thanks for the information. I will give it a try. For now, I tried playing with Cake_Session_Save and Security. I modified Cake_Session_Save to database and security to medium. These changes solved my current problems. Regards, Ritesh On Mar 7, 3:44 am, mindcharger [EMAIL PROTECTED] wrote: Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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
RE: sessions problem
You can also add your custom handler. For example I will replicate the way CakePHP handles sessions but leaving trans_sid ON (CakePHP deactivates it). To do just that: 1. Create a file app/config/session_cake_use_trans_sid.php with: ?php if (function_exists('ini_set')) { ini_set('session.serialize_handler', 'php'); ini_set('session.use_cookies', 1); ini_set('session.name', CAKE_SESSION_COOKIE); ini_set('session.cookie_lifetime', $this-cookieLifeTime); ini_set('session.cookie_path', $this-path); ini_set('session.gc_probability', 1); ini_set('session.auto_start', 0); ini_set('session.save_path', TMP . 'sessions'); } ? 2. On app/config/core.php change: define('CAKE_SESSION_SAVE', 'php'); to: define('CAKE_SESSION_SAVE', 'session_cake_use_trans_sid'); So you get the idea :) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de mindcharger Enviado el: Jueves, 08 de Marzo de 2007 05:21 a.m. Para: Cake PHP Asunto: Re: sessions problem That particular define controls ao CAKE handles sessions...you have 3 choices: * php - CAKE uses PHP Session to store Session Data * database - CAKE uses DB to store Session Data * cake - CAKE uses a temp file to store Session Data So, I think that NOT TELLING cake how you want it to handle the Sessions is not a good ideia... You really should pick an option from above and try it to make it work, because you cannot tell how cake will behave if nothing is defined as the place-holder for session data... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: sessions problem
You can also add your custom handler. For example I will replicate the way CakePHP handles sessions but leaving trans_sid ON (CakePHP deactivates it). To do just that: 1. Create a file app/config/session_cake_use_trans_sid.php with: ?php if (function_exists('ini_set')) { ini_set('session.serialize_handler', 'php'); ini_set('session.use_cookies', 1); ini_set('session.name', CAKE_SESSION_COOKIE); ini_set('session.cookie_lifetime', $this-cookieLifeTime); ini_set('session.cookie_path', $this-path); ini_set('session.gc_probability', 1); ini_set('session.auto_start', 0); ini_set('session.save_path', TMP . 'sessions'); } ? 2. On app/config/core.php change: define('CAKE_SESSION_SAVE', 'php'); to: define('CAKE_SESSION_SAVE', 'session_cake_use_trans_sid'); So you get the idea :) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de mindcharger Enviado el: Jueves, 08 de Marzo de 2007 05:21 a.m. Para: Cake PHP Asunto: Re: sessions problem That particular define controls ao CAKE handles sessions...you have 3 choices: * php - CAKE uses PHP Session to store Session Data * database - CAKE uses DB to store Session Data * cake - CAKE uses a temp file to store Session Data So, I think that NOT TELLING cake how you want it to handle the Sessions is not a good ideia... You really should pick an option from above and try it to make it work, because you cannot tell how cake will behave if nothing is defined as the place-holder for session data... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: sessions problem
Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- 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: sessions problem
Hi mindcharger, Thanks for the information. I will give it a try. For now, I tried playing with Cake_Session_Save and Security. I modified Cake_Session_Save to database and security to medium. These changes solved my current problems. Regards, Ritesh On Mar 7, 3:44 am, mindcharger [EMAIL PROTECTED] wrote: Yep! They're the same... The phpinfo() shows the php.ini info, plus a couple more stuff... You don't have acess to php.ini? Well...let's see what we can do... First of all, you can force manually the session start...how? Like this: session_start(); $_SESSION['car'] = 'Dodge Charger R/T'; This code, placed on your controller, starts the session and stores a session variable named car with value Dodge Charger R/T. Then you, when you're done you can kill the session with: session_destroy(); And that should do it... Good luck! On Mar 6, 10:39 am, bingo [EMAIL PROTECTED] wrote: Hi, I checked my phpinfo() details and over there it shows session_cookie_lifetime = 0. Is this the same cookie_lifetime you were talking off or is there some other...I don't have access to php.ini file.. Regards, bingo On Mar 6, 5:24 am, mindcharger [EMAIL PROTECTED] wrote: Hi, To make the session time longer go to php.ini and set session.cookie_lifetime to 0 that means (keep session alive until browser is closed)... As for security risks...I think you can answer that for yourself...if there wasn't risk, there would be no session...:-) The rule: Longer Sessions, Less Security As for gmail, I don't know how it works, but I think it must do some sort of session renewal... Good luck On Mar 5, 2:39 pm, bingo [EMAIL PROTECTED] wrote: I have a similar problem.once I login successfully and if there is no activity, the session exprires automatically after few minutes.. Does it mean, I need to increase session.gc_maxlifetime . What should be the value if I want session remain active indefinitely...and what are the security risks with that...I am wondering how my gmail session always remain active... looking forward for some insights regards, bingo On Mar 3, 8:09 am, mindcharger [EMAIL PROTECTED] wrote: Hello, Do you the PHP Sessions active? This is not CAKESession, is PHPSession. To check if you have the PHP Sessions active go to your php.ini file, find the 'Session' section and check for something like this: session.auto_start = 1 //This will turn on thesessionsession.gc_maxlifetime = 1440 // this is th # of seconds your data will remain insessionsession.cache_expire = 180 // this is the # of minutes after wich your document will expire These are the things I believe that can go wrong with your description... Good luck! On Mar 2, 7:07 pm, jamiro [EMAIL PROTECTED] wrote: hi , I have a problem in the handling of sessions, my configuration in core.php is: define('CAKE_SESSION_SAVE', 'php'); define('CAKE_SECURITY', 'medium'); now my problem is when refresh the page (or change the page), my sessionid changes and I cannot read the stored thing previously: here an example of my situation: file: a_controller.php function index($id=1) { $this-Session- write('estandar', $id);} file: b_controller.php function index() { $estandarSession=$this-Session- read('estandar');} $estandarSession receives nothing... some suggestion? thanks sorry for my terrible english ...- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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 -~--~~~~--~~--~--~---