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

Hello monks. I am in need of advice here once again on session management. I've been working on a site for sometime now and had everything working with cgi::session. However, I just put my stuff up on the webserver and realized that the place my boss chose to use for hosting everything only supports standard components of the activestate perl engine. They will not add/remove or install third party sub components to enhance features for security reasons. Everything that comes with the standard perl engine from activestate.com is what is supported. Therefore, my question now is: What advice do you all recommend I should use for session management (login restriction, shopping cart, etc...) that is supported for activestate perl. I need something that will allow me to port what I have down in cgi::session over to the new session management scheme in a fast and effective way. Any suggestions please!
  • Comment on Porting from cgi::session to using built in activeperl management

Replies are listed 'Best First'.
Re: Porting from cgi::session to using built in activeperl management
by BUU (Prior) on Jul 12, 2004 at 19:06 UTC
    A) Yell at your hosts for being stupid.

    B) CGI::Session is a "perl only" module, which means all you need to install it is simply upload it to some folder then tell perl where to find it.

      To clarify what BUU said, A) You should probably communicate more with your boss. B) lib.pm is likely what you want.

      Say you can upload to C:\WWW\, make a directory called lib. Under lib\, add a directory, CGI, and Session.pm inside that. Now, before your code tries to pull in CGI::Session, do a use lib 'C:\WWW\lib';.

      Actually, './' is always in @INC, so you could just make the CGI directory in the same folder as your scripts (say C:\WWW\HTDOCS\), but that could get messy.

      mhoward - at - hattmoward.org
        Ok, I will try that. I also found some help at  http://www.rcbowen.com/imho/perl/modules.html if anyone else may ever need it. Thanks!
        I'm still getting an error and I'm a little confused. Please tell me if I'm doing this correct. I used the link to go to cpan.org and I clicked on the Source link, copied, and saved it to a file as  lib.pm. I then uploaded it to the top of the directory in the server. I then created a sub-dir from the top-level-dir called lib and a sub-dir in this called CGI where I put the source file Session.pm. I then tried to access the script I was using it for and got a server error. I included the file as
        use lib '\lib';
        Then I tried  use lib '/lib' and use lib 'lib'; I'm not sure what I'm doing wrong here or missing and I know the script works b/c when I take out the use lib... part it runs fine. Please help. Thanks
      *Sign of relief* SO I don't have to rewrite all of my session management scripts. That is a big relief. Now this may sound stupid but I'm used to installing modules the "normal" way.
      perl Makefile.PL make make test make install
      How do I do this "manually" where I actually put the file in the directory. I assume on the use CGI::Session I specify a path. However, I'm not sure what and where everything is supposed to go. Thanks so much. (btw, I decided to switch host today since parcom seems to not support anything I need Any suggestions for good windows perl host are welcome).
        Why are you trying to find a *windows* *host*? Especially if you're using perl and such like.