I recently began using CGI::Application and HTML::Template to make better CGI apps. I started to add Apache::Session::File and to control session data. I currently have an email app and do not want the message body on the URL line when going to the next run mode. I got Apache Session working but when going to the next run mode a new session is created. It seems that sub Setup is running every time the app is called and I don't think that is right? Does anyone have any thoughts on this? Todd Cox NCI Network Support Rockville, MD
sub setup { my $self = shift; $self->start_mode('mode1'); $self->run_modes( 'mode1' => 'showSelectGroup', 'mode2' => 'showSelectGroupEmail', 'mode3' => 'showComposeMessage', 'mode4' => 'showConfirm' ); $self->tmpl_path("c:/Apache/htdocs/ncimail/"); my @prop; # Store the properties in a file so it is easily changed. open(PROP,"c:/apache/prop/ldap.properties") || die "Can't open l +dap.properties for reading!"; while(<PROP>) { chomp; push(@prop, $_); } close(PROP); my $hostname = $prop[4]; my $search_dn = $prop[5]; my $search_pwd = $prop[6]; my $scope = $prop[7]; my $port = $prop[8]; my $ldap = Net::LDAPS->new($hostname,port => $port,timeout => TI +MEOUT) or die "Can't connect to LDAP server " . $hostname; my $result = $ldap->bind($search_dn, password => $search_pwd, ve +rsion => 3); my $error = $result->error(); if($error ne "Success") { print ("<BR>LDAP Bind Error: $error<br>"); exit; } my %session; my $id; tie %session, 'Apache::Session::File', $id, {Directory => 'c:/ap +ache/tmp/sessions', LockDirectory => 'c:/apache/tmp/lock'}; my $session_id = $session{_session_id}; $self->param('session_id' => $session_id); }

In reply to CGI::Application and Session problem by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.