I am trying to port some code running on a Linux machine to a Windows 8.1 machine running xampp. I am stumped as to why my cookies aren't getting stored and retrieved. Here's what I'm doing:

!\xampp\perl\bin\perl

use CGI;
use CGI::Session;
my $cgi = new CGI;
my $sid = $cgi->cookie("CGISESSID") || undef;
my $session = new CGI::Session(undef, $sid, {Directory=>'\xampp\htdocs\aeis\tmp'});

This seems simple enough but the cookie doesn't get set which means the session information isn't found when the next page is opened. The session file is created in the tmp folder and what I see in there is what I expect.

I'm sure that I'm missing something simple but at this point I'm so frustrated that I'm about ready to bag it take up farming.

Thank you to anyone that is able to help me with this!!!

Huh? From what I understand, cookies values are stored on the client side and session values are stored on the server side. So does your script store the value on the client side? You need Javascript to manipulate with the cookies and send their values back to the server side, so that you can use it.

From your script, I am seeing that you are expecting cookies values passed through "CGISESSID" parameter back to the server side. Did you set the cookies on the client side after the client login/view?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.