cakephp-2.3

How can I set the samesite cookie attribute in CakePHP 2.3?

流过昼夜 提交于 2020-12-15 06:38:34
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

How can I set the samesite cookie attribute in CakePHP 2.3?

余生长醉 提交于 2020-12-15 06:38:17
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

Echo String dont work properly

末鹿安然 提交于 2020-02-08 05:47:43
问题 I'm using cakePHP 2.x. I'm trying to render a view with an empty layout. The view should contain only a string returned from the action controller with no html code. Here is the code: public function checkout(){ $ref =null;$act=null;$par=null; $this->layout = false; //$this->render(false); //$priceCTP = $this->Session->read('priceCTP');; $priceCTP = $this->getPrice(); //var_dump(session_save_path()); if (isset($this->params['url']['Reference'])) { $ref = $this->params['url']['Reference']; }

Rewriting url using routes in cakephp

北慕城南 提交于 2020-01-25 22:22:37
问题 I am trying to create a custom route in cakephp.I need the url in the following format http://domain.com/mygroup?id=23 I am trying like the following Router::connect('/:sluggroup?id=:id', array('controller' => 'groups', 'action' => 'postdetail'),array('pass' => array('sluggroup','id'))); How can i achieve this? Thanks... 回答1: Try using the route: Router::connect('/:group/*', array('controller'=>'groups','action'=>'postdetail'), array( 'pass' => array('group') ) ); This will route everything,

Cakephp image -Can not determine the mimetype

放肆的年华 提交于 2020-01-23 07:00:27
问题 cakephp 2.3 I'm uploading an image and I have an error saying that: Can not determine the mimetype. Error: An Internal Error Has Occurred. On my Model this is a part of my $validation 'file_name' => array( 'uploadError' => array( 'rule' =>'uploadError', 'message' => 'Your image upload failed', 'allowEmpty' => FALSE, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), 'mimeType' => array(

Attach multiple files to email in CakePHP

不想你离开。 提交于 2020-01-17 18:09:10
问题 I want to attach 5 dynamic text file in mail but not working. I send single attachment in email working perfect my code is : $Email->attachments('path/to/example.txt'); But i send multiple attachment in email not working. My code is : $Email->attachments('path/to/example.txt','path/to/example1.txt','path/to/example3.txt','abs/path/to/example4.txt','path/to/example5.txt'); 回答1: Try this code for multiple attachment : $Email->attachments(array( 'example.txt' => array( 'file' => 'path/to/example

How to increase the login time for cakephp 2

扶醉桌前 提交于 2020-01-17 13:57:22
问题 Can you please let me know how to increase the session expiry time for CakePHP 2? Currently, i set the configuration as bellow. Configure::write('Session', array( 'defaults' => 'php', 'timeout' => 129600, // The session will timeout after 30 minutes of inactivity 'cookieTimeout' => 129600, // The session cookie will live for at most 24 hours, this does not effect session timeouts 'ini' => array( 'session.gc_maxlifetime' => 129600 // 36 hours ) )); But, these settings not work and session

CakePHP request data limits

你。 提交于 2020-01-14 10:28:24
问题 When I try to send a large amount of data from a CakePHP (v2.3.3) form, the $this->request->data array contains only some of the data (approximately the first 1000 values). Does CakePHP truncate this array? What can I do to get the rest of the data? (I've tried increasing post_max_size in php.ini, to no effect.) Thanks. 来源: https://stackoverflow.com/questions/21145441/cakephp-request-data-limits

CakePHP request data limits

六眼飞鱼酱① 提交于 2020-01-14 10:28:07
问题 When I try to send a large amount of data from a CakePHP (v2.3.3) form, the $this->request->data array contains only some of the data (approximately the first 1000 values). Does CakePHP truncate this array? What can I do to get the rest of the data? (I've tried increasing post_max_size in php.ini, to no effect.) Thanks. 来源: https://stackoverflow.com/questions/21145441/cakephp-request-data-limits

Can't change 'userModel' using AuthComponent in CakePHP

我的梦境 提交于 2020-01-06 14:58:13
问题 I'va been trying to change the 'userModel' from the default 'user' to 'usuario'. I'va done this before in CakePHP 1.3 but I can't get it to work using the lastest version. Here's my code (AppController.php): App::uses('Controller', 'Controller'); class AppController extends Controller { public $components = array( 'Auth' => array( 'loginError' => "Nombre de usuario o contraseña incorrectos.", 'authError' => "Debes ingresar con tu cuenta de usuario.", 'loginRedirect' => array('controller' =>