Kenneth's Bookmark

« Back to posts
  • Viewed
    times

Filed under

  • cakephp
  • ssl
January 12, 2011

nuts and bolts of cakephp | Tag Archive | cakephp ssl enforce

  • Edit
  • Delete
  • Tags
  • Autopost

A simple way to check and enforce SSL can be done by using the RequestHandler component.
Here’s an example:

?
1
2
3
4
5
private function checkHttps() {
  if(!$this->RequestHandler->isSSL()) {
    return $this->redirect('https://' . env('SERVER_NAME') . $this->here);
  }
}
via nuts-and-bolts-of-cakephp.com

 

Tweet
  • 0 responses
  • Like
  • Comment