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

I have a server main page wherein i have to fill some text fields and drop down according to an input file. This will lead me to one of many 2nd pages according to the input params. Then again on the 2nd page (form) i have to fill in few parameters and submit it to get the reqd data. I am not being able to maintain a single session for this. If i directly paste the URL of one of the 2nd pages in the brosew address bar, it says no session error. I have to go to the 1st page to start a session and from it go to whichever 2nd page is desired. Does anyone know how I could pass the session information in perl ?

Replies are listed 'Best First'.
Re: Maintaining Session
by Aristotle (Chancellor) on Sep 08, 2004 at 22:19 UTC

    The easiest way would be to use CGI::Session. Or one of the many other ::Session modules on CPAN.

    Makeshifts last the longest.

Re: Maintaining Session
by CountZero (Bishop) on Sep 08, 2004 at 22:00 UTC
    The cleanest way is probably to keep your session variables in hidden fields and pass these along from page to page.

    Cookies are used for it as well, sometimes in combination with a database (to store the session data).

    If your web-server is Apache, there are numerous session-modules who play nice with Apache!

    Or you could have your users log-in and use their log-in name as the key to a database storage of their session data.

    CountZero

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