shaolindoman has asked for the wisdom of the Perl Monks concerning the following question:

I am creating a login script which 1)has the login in form 2)then calls an external script to check the user name and password and 3)then goes back to the original or into the logged in page depending on the un/pw check. My question is how do I do a redirection from the external script back to the other script(s) and PASS PARAMETERS? I need to pass the sessionID mainly. I also need this to be safe so I'm not sure what the safest way is: a cgi redirection or a system call (I'm not very skilled in calling a script within a script, I've only done this a couple times)? Either way, how do I pass the parameters? And, I really don't want any information like the sessionID displayed at the top of the browser address bar (like the paramers). Any suggestions?
  • Comment on Passing cgi parameters from external script

Replies are listed 'Best First'.
Re: Passing cgi parameters from external script
by neniro (Priest) on Jun 29, 2004 at 20:23 UTC
    If you dislike to see the passed parameters in the URL, you have to use the POST method instead of GET. If you want to pass "invisible" data between scripts you can store this data in a temporary file and pass the filename to the other script, or you use a database backend. Of course there are a lot of modules on CPAN concerning session-handling.

    neniro

      Well, I'm using cgi::session right now. I was just looking for a way to directly call a script from the external script and pass parameters without using any type of form input data.
Re: Passing cgi parameters from external script
by CountZero (Bishop) on Jun 29, 2004 at 21:33 UTC
    Whats wrong with the standard web-server's authentication / authorization way of handling log-in? If you manage your log-in names well, you can use these as some form of sessionID (unless you expect the same user to open several different sessions at the same time).

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Right now I don't have a web server to run my site from. I'm doing the site at home for a small business (my first venture into this sort of thing) and I'm just running it off my local host. Therefore, when I finish I plan to then start looking for web-server's to host the site and scripts. So I'm not sure there is any way I could use the standard web-server's authentication / authorization way of handling log-in without knowing where and how my site will be hosted. Unless there is a standard they all use. I know I will have to use a Windows server because the site makes extensive use of MS access which is what the business I am doing this for uses. But I'm not sure how to take advantage of things in terms of the server. All I know is what I have been working with in terms of perl/cgi stuff. Any suggestions for reading on an intro to this sort of thing?
        Sorry, Microsoft Windows web-servers are terra incognita for me. I run Apache servers on Windows systems and there is no reason why they couldn't access MS Access (other than that MS Access is not very multi-user friendly and it hardly warants to be called a database-server (it is more a glorified graphical front-end to their Jet-engine)).

        But I would really hesitate to use MS Access databases on a web-server, given that there are so many fine free database-servers available.

        As much will depend on what server you run your scripts on, I advise you to first start looking for a host before committing too much to a certain design as much may need to be re-written if the host does not support some (or all) of your requirements.

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law