A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearSelectively enabling SSL for certain actions in CakePHP - page 1
User InfoPosts
Selectively enabling SSL for certain actions in CakePHP#1
I(m trying to enable SSL for only certain actions on my CakePHP based website. I(m doing this using requireSecure() and redirecting to https://url in the corresponding blackHoleCallback().

To keep the server load down, I(d like to redirect back to http://whatever_url once the user is done with the action that requires SSL.

How do I do this?

posted date: 2009-04-15 03:44:00


Re: Selectively enabling SSL for certain actions in CakePHP#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-15 03:44:01


Re: Selectively enabling SSL for certain actions in CakePHP#3
So this is one solution I(ve come upon. I add the following snippet to beforeFilter() in AppController:if (!in_array($this->action, $this->Security->requireSecure) and env((HTTPS()) $this->_unforceSSL();The function is defined as:function _unforceSSL() { $this->redirect((http://( . $_SERVER[(SERVER_NAME(] . $this->here);}

posted date: 2009-04-15 03:59:00


Re: Selectively enabling SSL for certain actions in CakePHP#4
Make sure to use a cookie that requires a secure connection for the secure pages, and a normal cookie for non secure pages. This way, if someone captures the non secure cookie, they won(t be able to hijack any sensitive information.

posted date: 2009-07-08 02:30:00


Re: Selectively enabling SSL for certain actions in CakePHP#5
what I don(t like with the redirect approach is that the user still goes to the unsecure url and only after this he is redirected.I wanted something done at the html->link/url level where depending on what you pass a ssl/non-ssl link is returned, something similar with:http://cakephp.1045679.n5.nabble.com/Re-Login-through-HTTPS-on-CakePHP-td1257438.htmlbut also using the secure componentlater edit, I did something easier that just did my job done, I try to create a simple example (don(t forget to define MYAPP_SECURE_URL in config/core.php or bootstrap.php):in app I created app_helper.php:class AppHelper extends Helper { function url($url = null, $full = false) { if($url[(action(] == (login( && $url[(controller(] == (users() { return MYAPP_SECURE_URL.(/users/login(; } return h(Router::url($url, $full)); }}

posted date: 2011-10-11 00:19:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.