Passing a URL as a URL parameter

Posted by Andrea on Stack Overflow See other posts from Stack Overflow or by Andrea
Published on 2010-04-21T14:45:16Z Indexed on 2010/04/21 15:23 UTC
Read the original article Hit count: 310

Filed under:
|
|

I am implementing OpenId login in a CakePHP application. At a certain point, I need to redirect to another action, while preserving the information about the OpenId identity, which is itself a URL (with GET parameters), for instance

https://www.google.com/accounts/o8/id?id=31g2iy321i3y1idh43q7tyYgdsjhd863Es

How do I pass this data? The first attempt would be

function openid() {
    ...
    $this->redirect(array('controller' => 'users', 'action' => 'openid_create', $openid));
}

but the obvious problem is that this completely messes up the way CakePHP parses URL parameters.

I'd need to do either of the following:

1) encode the URL in a CakePHP friendly manner for passing it, and decoding it after that, or

2) pass the URL as a POST parameter

but I don't know how to do this.

EDIT: In response to comments, I should be more clear. I am using the OpenId component, and I have a working OpenId implementation. What I need to do is to link OpenId with an existing user system. When a new user logs in via OpenId, I ask for more details, and then create a new user with this data. The problem is that I have to keep the OpenId URL throughout this process.

© Stack Overflow or respective owner

Related posts about php

Related posts about cakephp