cake.example | A simple cake example for https | Web Framework library
kandi X-RAY | cake.example Summary
kandi X-RAY | cake.example Summary
A simple cake example for
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cake.example
cake.example Key Features
cake.example Examples and Code Snippets
Community Discussions
Trending Discussions on cake.example
QUESTION
I'm re-building a web application in CakePHP 3 and plan to change how the application is structured. At the moment the architecture is as follows - and none of it is written in Cake.
There is a login page at https://app.example.com
which sets PHP session variables on successful login. All of the applications are then in sub-directories, e.g.
ANSWER
Answered 2017-May-08 at 15:00Checking the session manually can be just as secure as using CakePHPs auth component, as the component does exactly the same (given that you'd be using the session storage), just with data that you've set via AuthComponent::setUser()
, ie it all depends on whether you implement things properly.
Checking the session value in AppController::beforeFilter()
, and redirecting if necceesary should generally be fine, and as mentioned is pretty much the same as what the auth component does internally, it will check whether the configured session key is present and not empty.
You could possibly still leverage the CakePHP auth functionality if you wanted to, the flat u_id
value in the session should suffice. For the auth component, just configure the login/logout options and the session storage key accordingly, ie if your login page is at https://app.example.com
, and your login app writes auth data to $_SESSION['u_id']
, configure the auth component like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cake.example
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page