interestingly enough, whenever i try creating a virtual directory with IIS (5.1) - (WinXP), my session objects somehow gets lost somewhere in between pages.

to do this :

1.) create a folder "test" let's say on C:\ and put all teh files inside.
2.) right click on the folder, properties->websharing->share the folder and check everything in checkboxes.
3.) now access testsession.pl with a web browser.
4.) the page will show, with session id, and also it'll show on the next page with its found session object.

5.) now..

6.) go to IIS, under default web site, find "test" virtual directory and set its properties->directory security->anonymous access checked.
7.) apply and restart IIS.

8.) now, try running testsession.pl again...and when you move to the next page, your session is gone!

why is this happening??? (happening to me).

the reason why i wanted to set anonymous access on lower level folder "test" is because it'll prompt me a authentication screen if i use ie6 or firefox when viewing the first page.

file 1 : testsession.pl
#!/usr/bin/perl print "content-type: text/html \n\n"; use CGI; use CGI::Session qw/-ip-match/; use File::Spec; # my $session = new CGI::Session("driver:File", undef, {Directory=>Fil +e::Spec->tmpdir}); my $session = new CGI::Session(); my $sessionid = $session->id(); print "<BODY>"; print " <FORM ACTION=\"testsession2.pl\">"; print "<INPUT TYPE=\"hidden\" NAME=sessionid VALUE=" . $sessionid . "/ +>"; print "current session : " . $sessionid; print "<INPUT TYPE=\"SUBMIT\" VALUE=\"go next\">"; print "</FORM>"; print "</BODY>";


testsession2.pl
#!/usr/bin/perl print "content-type: text/html \n\n"; use CGI; use CGI::Session qw/-ip-match/; my $cgi = new CGI; my $sessionid = $cgi->param("sessionid"); print "current session id ($sessionid)"; my $session = CGI::Session->load($sessionid); if(!$session->is_empty()){ print "<BODY>"; print " <FORM ACTION=\"testsession.pl\">"; print "<br><br>found session object from sessionid : " . $session- +>id(); print "<INPUT TYPE=\"SUBMIT\" VALUE=\"back\">"; print "</FORM>"; print "</BODY>"; }else{ print "<BODY>"; print " <br><br>weird enough...session object is lost!"; print "</BODY>"; }

In reply to CGI::Session not saving with IIS by adrive

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.