Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found