How to transfer login information and automatically log to another website, when user click on link?

php

Solution

No no no - do not pass the username + password in plain text in the URL!

I would recommend taking a look at how you know that the user is logged in on site A. Is there some sort of flag in your database marking this user as logged in? Could site B somehow be aware of this flag? Since your two sites share a database, this would definitely be possible.

Consider the following scenario:

- User logs into site A.

- A unique "login token" is generated, saved in your database and also sent to the client.

- User arrives at site B.

- The user sends the "login token" they previously recieved to the server.

If the login token sent by the user matches the record in the database you can skip the authentication phase and mark that user as logged into site B.

Problem

I have hosted 2 website, these two website use same database to populate data. eg: users - table has user login details, both website users can access their login via this table. Now I want to do this: Before access both website they need to login. My "Website A" has link call "Read More" when user click on it, that user should be redirect to "Website B". Now I want to skip "Login" process from B website(because that user already loged in A). How to do that, I got mind this option, but less security: - A website read more link as B_website/?username=abc&password=123&page=12 I guess this is not good option, what are the ways i can do this with keep high security?

Original source

Related problems