[development] Anonymous to Authenticated User Cookies

Randy Fay randy at randyfay.com
Fri Sep 24 04:42:12 UTC 2010


So what's going on here is that in Drupal you can use the ?destination=
parameter with any simple form, and after the form submits, you'll be
returned to the path listed in the destination parameter.

So, if instead of just going to user/register, I go to
user/register?destination=some/path, after the registration submits, you'll
be returned to the path in the destination, as long as the form does not
override this.

You can try this out. My local is d6git.l. I go unauthenticated to

http://d6git.l/user/register?destination=some/path

and I register. When I press submit on the registration, I end up at
some/path.

So all you need is a module that creates links to user/register that have
the current page in the destination param. Instead of having a block with
links to user/register in it, you have a block with links to
user/register?this/page.

-Randy

On Fri, Sep 24, 2010 at 1:48 AM, nan wich <nan_wich at bellsouth.net> wrote:

> Because if I have to show the code, then I would be disclosing something
> the customer owns. I don't know if I can sanitize it enough and have it
> still be readable.
>
>
> *Nancy*
>
>
>
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L.
> King, Jr.
>
>
>  ------------------------------
> *From:* Domenic Santangelo <domenics at gmail.com>
> *To:* development at drupal.org
> *Sent:* Thu, September 23, 2010 4:30:30 PM
> *Subject:* Re: [development] Anonymous to Authenticated User Cookies
>
> I too use the destination param. I have noticed that you must be careful
> not to let it get lost if you're going to several intermediary pages.
>
> Curious as to why you'd want to take code off-list, surely the solution
> would be beneficial to the community?
>
> -D
>
>
>  On Sep 22, 2010, at 8:27 AM, nan wich wrote:
>
>   I do this simply by using the "destination" query parameter. If you need
> more details on my code, we will have to take this off-list.
>
>
> *Nancy*
>
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L.
> King, Jr.
>
>
>  ------------------------------
> *From:* AustinCMS <chana at austincms.com>
> *To:* development at drupal.org
> *Sent:* Tue, September 21, 2010 8:12:28 PM
> *Subject:* [development] Anonymous to Authenticated User Cookies
>
> I have the following scenario:
>
> 1. Anonymous user browses site.
> 2. He clicks on link (on Screen A)
> 3. He is informed he must login to proceed further (-> to Screen B)
> 3. He clicks on "Register" which takes him to account creation (Screen C)
> and on form submit to Content Profile for profile creation (Screen D).
>
> Client then wants newly-created and authenticated user to be taken back to
> Screen B. In other words - where he was trying to head before
> being re-routed into creating an account and profile.
>
> There seems to be a lot of discussion and proposed "solutions" for this
> scenario - but none that actually really work. Login Destination module
> doesn't work because of Content Profile incompatibilities. AFAIK,
> LogonToboggan allows you to set a target after login - but not with the
> intermediate
> step of Profile creation. I can get a user back to the page where he logged
> in IF he is already an authenticated user and logging in from the User Login
> box. But so far, that is the
> only scenario that works even remotely closely.
>
> I'd like to understand better how cookies are managed in
> Drupal...especially going from an Anonymous session to an authenticated one
> under the scenario above.
>
> I'd appreciate info - or a link to a good resource, if possible...
>
> Thanks in advance!
>
> Chana
>
>
>
>
>
>


-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100924/144be603/attachment-0001.html 


More information about the development mailing list