Re: Auth problem: Page refresh or multiple page loads lead to logout
Wow, setting the Variable "Security.level" to "medium" definetly did the trick!! Great! Thank you, Dr. Loboto. --~--~-~--~~~---~--~~ 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: Auth problem: Page refresh or multiple page loads lead to logout
Yeah, I am interested in that matter too. I have a lot of ajax requests and when I click some buttons multiple times while the request is beeing processed, I get kicked out - i.e. the session is destroyed and I end with the login form. So, what session storage engine could be used? This is annoying problem and I still haven't get rid of it. On Apr 3, 10:08 am, "Dr. Loboto" wrote: > It looks like problem with concurrent access to session files. > Standard advice in all such cases - try to set lower security level. > Actually, I don't know how can it help, but it is really common > advice. > Other advice - choose session storage engine that works better with > concurrent requests. > > On Apr 2, 10:57 pm, Andreas Müller wrote: > > > > > Hello, > > I have some issues with two CakePHP (current stable version) > > applications regarding Auth. > > > When a user is logged in and loads multiple pages simultaneously, he > > gets logged out. This happens for example when he follows a hyperlink > > while the page is still loading or if he hits "F5" twice. > > > Furthermore, the user receives the message: "You are not authorized to > > access that location." > > > This is the code from my App_Controller: > > > function beforeFilter(){ > > > Configure::load('settings'); // My application configuration > > > $this->Auth->loginAction = array('controller' => 'users', > > 'action' > > => 'login'); > > $this->Auth->autoRedirect = false; > > > $this->Auth->loginError = > > Configure::read('Auth.LoginError'); > > $this->Auth->authError = Configure::read('Auth.AuthError'); > > > $this->Auth->authorize = 'controller'; > > } > > > function isAuthorized() { > > return true; // For testing! > > } > > > It seems that the app cannot process multiple requests in the same > > session at the same time. But it should, to my view.. :-) > > > Does somebody of you have a clue, why this could happen or where to > > start searching? > > > Thanks and greetings from Kiel/Germany, > > Andreas- 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: Auth problem: Page refresh or multiple page loads lead to logout
It looks like problem with concurrent access to session files. Standard advice in all such cases - try to set lower security level. Actually, I don't know how can it help, but it is really common advice. Other advice - choose session storage engine that works better with concurrent requests. On Apr 2, 10:57 pm, Andreas Müller wrote: > Hello, > I have some issues with two CakePHP (current stable version) > applications regarding Auth. > > When a user is logged in and loads multiple pages simultaneously, he > gets logged out. This happens for example when he follows a hyperlink > while the page is still loading or if he hits "F5" twice. > > Furthermore, the user receives the message: "You are not authorized to > access that location." > > This is the code from my App_Controller: > > function beforeFilter(){ > > Configure::load('settings'); // My application configuration > > $this->Auth->loginAction = array('controller' => 'users', > 'action' > => 'login'); > $this->Auth->autoRedirect = false; > > $this->Auth->loginError = Configure::read('Auth.LoginError'); > $this->Auth->authError = Configure::read('Auth.AuthError'); > > $this->Auth->authorize = 'controller'; > } > > function isAuthorized() { > return true; // For testing! > } > > It seems that the app cannot process multiple requests in the same > session at the same time. But it should, to my view.. :-) > > Does somebody of you have a clue, why this could happen or where to > start searching? > > Thanks and greetings from Kiel/Germany, > Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Auth problem: Page refresh or multiple page loads lead to logout
Hello, I have some issues with two CakePHP (current stable version) applications regarding Auth. When a user is logged in and loads multiple pages simultaneously, he gets logged out. This happens for example when he follows a hyperlink while the page is still loading or if he hits "F5" twice. Furthermore, the user receives the message: "You are not authorized to access that location." This is the code from my App_Controller: function beforeFilter(){ Configure::load('settings'); // My application configuration $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->autoRedirect = false; $this->Auth->loginError = Configure::read('Auth.LoginError'); $this->Auth->authError = Configure::read('Auth.AuthError'); $this->Auth->authorize = 'controller'; } function isAuthorized() { return true; // For testing! } It seems that the app cannot process multiple requests in the same session at the same time. But it should, to my view.. :-) Does somebody of you have a clue, why this could happen or where to start searching? Thanks and greetings from Kiel/Germany, Andreas --~--~-~--~~~---~--~~ 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: page refresh?
just implmemented it works. lol cool :) i ended up doing a md5 on time() :) On Sep 30, 11:30 am, rocket <[EMAIL PROTECTED]> wrote: > interesting fix. thanks > > On Sep 29, 5:15 pm, "3lancer.eu" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > but when you change the picture, the old picture is still stuck in the > > > cache, so to see the new pic the user needs to push F5... I can't > > > figure out how to "refresh" the page automatically. > > > > any ideas? > > > Simplest way is to add some random query string at the end of the url, > > likehttp://example.com/images/some_profile_image.jpg?andThisIsSomeHash > > > It would be good to utilize the browser cache the proper way, so you > > can try to set 'andThisIsSomeHash' to something like > > md5($myModel['MyModel']['modified']) or md5(filemtime('images/ > > some_profile_image.jpg')); > > > Regards, > > Piotr --~--~-~--~~~---~--~~ 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: page refresh?
interesting fix. thanks On Sep 29, 5:15 pm, "3lancer.eu" <[EMAIL PROTECTED]> wrote: > Hi, > > > but when you change the picture, the old picture is still stuck in the > > cache, so to see the new pic the user needs to push F5... I can't > > figure out how to "refresh" the page automatically. > > > any ideas? > > Simplest way is to add some random query string at the end of the url, > likehttp://example.com/images/some_profile_image.jpg?andThisIsSomeHash > > It would be good to utilize the browser cache the proper way, so you > can try to set 'andThisIsSomeHash' to something like > md5($myModel['MyModel']['modified']) or md5(filemtime('images/ > some_profile_image.jpg')); > > Regards, > Piotr --~--~-~--~~~---~--~~ 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: page refresh?
Hi, > but when you change the picture, the old picture is still stuck in the > cache, so to see the new pic the user needs to push F5... I can't > figure out how to "refresh" the page automatically. > > any ideas? Simplest way is to add some random query string at the end of the url, like http://example.com/images/some_profile_image.jpg?andThisIsSomeHash It would be good to utilize the browser cache the proper way, so you can try to set 'andThisIsSomeHash' to something like md5($myModel['MyModel']['modified']) or md5(filemtime('images/ some_profile_image.jpg')); Regards, Piotr --~--~-~--~~~---~--~~ 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: page refresh?
Yahoo (guidelines on caching and optimisations) suggests that you never replace a picture under the same name. So when updating your design, for example, you would link your logo to "logo-1.1.gif" or something similar. They particularly suggest this "versioning" type of setup for logos and other pictures that are likely to be updated. /Martin On Sep 29, 9:37 am, rocket <[EMAIL PROTECTED]> wrote: > sup guys > i have an upload script, that lets you upload your profile pic. > > but when you change the picture, the old picture is still stuck in the > cache, so to see the new pic the user needs to push F5... I can't > figure out how to "refresh" the page automatically. > > any ideas? --~--~-~--~~~---~--~~ 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: page refresh?
use javascript http://grizzlyweb.com/webmaster/javascripts/refresh.asp On Sep 29, 12:37 pm, rocket <[EMAIL PROTECTED]> wrote: > sup guys > i have an upload script, that lets you upload your profile pic. > > but when you change the picture, the old picture is still stuck in the > cache, so to see the new pic the user needs to push F5... I can't > figure out how to "refresh" the page automatically. > > any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
page refresh?
sup guys i have an upload script, that lets you upload your profile pic. but when you change the picture, the old picture is still stuck in the cache, so to see the new pic the user needs to push F5... I can't figure out how to "refresh" the page automatically. any ideas? --~--~-~--~~~---~--~~ 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: Preventing Duplicate Record Insertion on Page Refresh
Well, it's hard to provide an answer like this.. Can you paste some code and explain to us what are trying to achieve? If you're inserting text and there is something else that needs to be unique, you will need a custom validation rule for your Model. On Dec 11, 12:58 pm, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ 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: Preventing Duplicate Record Insertion on Page Refresh
You should use the redirect after post pattern, using a HTTP 302 or 303 status code after saving your fields. if($this->Model->save()) $this->redirect($url, $code, $exit); On Dec 11, 12:58 pm, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ 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: Preventing Duplicate Record Insertion on Page Refresh
Create a session variable and set it to false. Have your page check the session variable every time it loads. If the session variable is false, save the data and set the variable to true. If it is true, don't save the data. I could be more specific, but I don't know exactly what you are doing. If you can give us an idea of what your app does, that would be great. hydra12 On Dec 11, 5:58 am, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ 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: Preventing Duplicate Record Insertion on Page Refresh
i am validating the data b4 inserting. but the data type is text.. the text will not be unique... explain me clearly... --~--~-~--~~~---~--~~ 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: Preventing Duplicate Record Insertion on Page Refresh
You should set some validation rules for your Model, and setup a custom rule to check whether the submitted data is already in the database, OR implement Model::beforeSave() Hope that helps, dr. H. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Preventing Duplicate Record Insertion on Page Refresh
I am developing a PHP-mysql database. It is noted that when the browser window is refreshed the data is inserted again in the database. unfortunately there is no unique keys that I can use to verify the existance of the data, so as to prevent the multiple insertion. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---