[ back to toc ]

session id

Date: 2002/05/08 09:48

Im new to cgi/perl .
something is wrong with the following code to create sessions.
it is working fine in console and creating session ids too.but not when we
try it on Konquerer.


use CGI;
use Apache::Session::File;

my $query = new CGI;
my %session;
my $id = undef;

$id = $query->cookie(-name=>"sess");

tie %session, 'Apache::Session::File', $id,
{ Directory => "/tmp/",
LockDirectory => "/tmp/"};

if ($id == undef) {
$cookie = $query->cookie( -name=>'sess',
print $query->header(-cookie=>$cookie);
print "Assigned session ID<br>";
} else {
print $query->header();
print "Not assigned session ID<br>";

$id = $session{_session_id};

print "<html>";
print " Your session ID is $id";
print "</html>";

2)when we try to create simple session ids (using random numbers)and store
it in cookies
print "Set-Cookie:........ etc
it works in konquerer too .

can u find what is wrong with the code?

Sorry but I can not teel you what the issue is. I do not know what
knoquerer is, I have never heard off.

Regarding the CGI.pm module usage it seems to be ok.


[ back to toc ]