[cgiapp] Persistence

Mark Fuller azfuller at gmail.com
Wed Mar 5 11:20:19 EST 2008


On Wed, Mar 5, 2008 at 4:47 AM, Mike Tonks <fluffymike at googlemail.com> wrote:
>
>  I'm struggling to accept the form method, because as you say no more
>  <a href="myapp.cgi?rm=next"> - unless of course we use javascript.
>
>  Now I like the old links, so cookies seems like a no brainer to me.
>  Can anyone explain why the form method is better and how you implement
>  links?

It sounds like you're changing from "a href" links to form-submit
actions? Why do you feel this is better? I got the impression from the
earlier discussion that form submission is better if data is being
changed. But, traditional links are better for things that don't
change anything, like navigation.

What was said earlier is that you wouldn't want to pass the sessionID
as a parameter on a URL. You could put it in a form (hidden field) to
solve some of the problems with people emailing a URL to others. But,
using a form forces you to use form submission when it's not the best
choice. If you use a cookie to pass the sessionID you can use URLs or
forms depending on which makes sense.

I've forgotten everything that was said earlier. Let me know if I
overlooked something important.

Also, not to confuse you, but you don't have to use "rm=" as the
runmode. If all your pages have a forward and backward feature, you
could use "direction=forward" or "page=5" or "page=advance". You can
name your runmode variable anything you want. But, if you're just
starting out, following tutorials you've read, it might be easier to
use the "rm" convention. (If you want to get really fancy you can name
your links like myapp.cgi/book_name/next and either parse the path in
your setup or use plugin::actionDispatch to do it for you
automatically).

Mark


More information about the cgiapp mailing list