switch-php | Easily switch between PHP versions | Command Line Interface library
kandi X-RAY | switch-php Summary
kandi X-RAY | switch-php Summary
Easily switch between PHP versions on your Mac. Requires Homebrew and works with Laravel Valet.
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 switch-php
switch-php Key Features
switch-php Examples and Code Snippets
Community Discussions
Trending Discussions on switch-php
QUESTION
I have code which changes the current user session, its thought for an admin - to login as a existing user, and back again.
For that I store information in the session and in the DB. So Later I can check that the user trying to become admin, has the session variable - and in DB is the corresponding entry. So an attacker would have to set a session variable, and then also create a DB entry - from that point of view it seems safe to me.
User flow is: The admin clicks a button, and that redirects him to a user frontend. Then in frontend is a button to get back to being admin.
Problem is I feel completely unsure about the following code, I am afraid having opened a security hole, or otherwise made a misstake. Overall this code is strange to me, working with PHP for years, but I never touched sessions.
Does this really properly create a new session?
...ANSWER
Answered 2018-Oct-23 at 15:25I would not do that if i were you. This is to risky.
If you want to make a user switch use a laravel plugin(if you are using laravel).
if you are not using Laravel then you can make an api call for your users and with the api generator you can make a switch system to log you in as the user you want to login as with a new token.
JWT is a api i use to do that and my userswitch works fine.
GoodLuck
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install switch-php
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