How to transfer session id to php site on site?

I have two websites on the same server with the URLs http: // testintranet / && & &&& & & & http: //mvc.testintranet/ so far they just run simple php. I was able to transfer the user between the two sites and save their session using the get: /? Header Session_id = 26c81c54a93e145ba2cc50a43d77c4ca

I have not had a problem doing this so far, but I'm trying to put cakephp on the second, cakephp seems to override the session id. How can I stop cakephp from doing this?

To be precise, http: // testintranet is a simple php, and I'm trying to transfer session information from this site to http: //mvc.testintranet where the cake is running.

+4
source share
1 answer

Too
I am sure that you could use a combination of controller logic and a small modification of your form to achieve this. I feel that there may be a better alternative, but I don’t have time to look far into it before I go to work. This solution should work fine, but I have never tested anything like this, so let me know.

In your form, you need to slightly modify the action using any variable in which you store your session_id instead of $ _SESSION ['id']:
form action = "http://mvc.testintranet.com/controller/action/" method = "post" then in your controller method (for this example, view):

function view($sessionId = null) { if($sessionId) { //do whatever you need to do here. For Example: $this->Session->write('Session.id', $sessionId); } 

TA-dah. Hope this helps, let me know how this works for you.

+2
source

All Articles