Link to home
Start Free TrialLog in
Avatar of jagguy
jagguyFlag for Australia

asked on

How do I automatically login to another database from a current website in cakephp

In cakephp I can login to a website no problem.
What I need to do is login and then click a button that will send me another cakephp website with its own login.
This works fine (on my pc) but I I need to automatically login to the website without having to login again

 echo $this->Html->link( 'link!', 'http://127.0.0.1/maths/numeracyStudents/dashboardst');
Avatar of Rob
Rob
Flag of Australia image

You use Curl and cookies.  Store the cookie on your server and reuse it to log into the other site as needed.

So in your controller, is there a specific action that initiates this?
?
Logan,

How does your solution cover this part?:
What I need to do is login and then click a button that will send me another cakephp website with its own login.

The server needs to make the connection to the other site, not the client
Avatar of jagguy

ASKER

Hi,
Thanks for the replies
Without an example in cakephp I cant spend hours fiddling and hoping something will work.
This either can be done or it cant. If it can can someone point me to an example please.
Of course it can be done but how I've done it may not work for your implementation.

I have a class I've called proxy that handles all the CURL calls. It maintains the cookies etc.

I'll post the code of that class soon when I'm at my laptop
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The server needs to make the connection to the other site, not the client


In the first website, i login and store the details using cookie and retrieve in second website on the first page.
Can you show a code example?