Are you getting session data from login site to non-Yii sites? Are you using PHP in the non-Yii sites? Chris Brickhouse has a series of postings about cooking your own Yii auth… anyway it had a function that could log a user on without a password. I have posted the link on here before.
I just noticed it should have been: How are you getting the session data? If you already know how to get session data from one site to the other, then just do the same and set the Yii session data as needed in the authenticatedUser action.
Backhouse site: I think the function I was refering to was in part 4, near the bottom.
Another idea: Can you modify the php site? If so you could JsonEncode to session information and POST it to the Yii site action for authenticated login.
In my other website I just take my informations in
the informations are in the session after the redirection. But in my yii website, there is nothing.
this is what I did :
My site controller : (I took this from the login action of the demo)
$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
$userLogged = true;
$userLogged = false;
//after the auth, we will be redirect to this yii website.
So, afetr the logIn on the other site, we come back in this action and we are goind to the UserIdentity->authenticate Action where there is :
public function authenticate()
/* If there are informations in session about the user, I have to say to the website that the user is logged in.*/
whith the var_dump, I check, what I have in session : this is the result :
I don’t think Yii clears the session data, it probably generates it’s own session_id.
In this thread, it sounded like you where able to get the information you wanted from one php site to another php site. That is what I was asking about. If true you should be able to do the same with authenticatedUser() function that Chris talks about.
Another question is if the php site/Yii site are on the same server? Where is session data physically saved in the php-site? Is it the same as the Yii-site. I believe session data can be saved in a db, purhaps you could save into db in one site, pass the session_id to the other site, and load the data from the db there.
I’ll try to send the sessionId to my auth site, my auth site could maybe create the “same” session and then yii could maybe retrieve informations. I’ll try that and will say if it is working or not.
If I go in an other direction, the authentification website could perhaps write something in a db if someone log in with the username/website/date/rights/role… and then in my yii website I could see if there is a new record in the DB, But if 2 users tried to log in at the same time, I guess I have nothing to be sure which record I have to take. (Seems to be a really bad solution)
And other option is to create a little webapp of my authentifiation website, and add it to my yii website, so I could store information directly in the yii session…
Anyway, even if tehre are other solutions, I’m pretty sure it is possible to pass data between php website to yii website so I prefer try to find this solution