logo

$5
Best way to redirect to a previous page after JanRain RPX login?

Normally, when people login using sfGuardUser plugin code, the code gracefully redirects them to the referrer. For example, if a user wants to see some member directory, but needs to login to do so, they first get bumped to the login screen, then they get sent to the member directory. That is graceful.

Now I'm enabling login via JanRain RPX. I'm looking for ideas about how to imitate the above kind of login. As it stands now, if a user wanta to go to some member directory, and are asked to login, and choose, via JanRain RPX, to use their Yahoo login, then first they go off to JanRain/Yahoo, then they get redirected back to the page where we check the response from Yahoo, and then log them in if the data from Yahoo is valid. The fact that they were going to member directory gets lost in all of that. Right now we just redirect them to the user/home, after login, because we are not sure where else to send them.

Suggestions about better ways to do this?

Lawrence Krubner | 07/27/10 at 10:21am | Edit


(1) Possible Answers Submitted...

  • avatar
    Last edited:
    07/27/10
    12:43pm
    Kiril Angov says:

    Of course, just save the referrer url in the session. I use the plugin: http://svn.symfony-project.com/plugins/sfRequestHistoryPlugin/README

    That should solve your problem :)

    • 07/27/10 11:28am

      Lawrence Krubner says:

      Interesting. I was assuming I should store the previous page in the SESSION, but I could not figure out how to do that on every page. A filter does seem like a good idea.

    • 07/27/10 12:42pm

      Lawrence Krubner says:

      Installed. That plugin is awesome. Wish I'd known about it before.

This question has expired.





Current status of this question: Completed