in reply to Re: Code works fine, but in subroutine does not... help plz!
in thread Code works fine, but in subroutine does not... help plz!

I was reviewing your example. As far as I can read, that's simply a login/logout script. So one of the two actions much take place. What about my situation, where I don't want to login or logout, I simply want to check if they're logged in, and what is displayed depends on whether or not they are logged in or not. If they're not logged in, then a session should no be created, but I believe these lines:
my $sessionid=$q->cookie("cgisessid")||$session->param("_SESSION_ID"); my $cookie_id = $q->cookie(CGISESSID=>$session->id);

in your example both creat a session (regardless of whether the person is logged in or not) and then creates a cookie (again, regardless of whether or not they're logged in.

or am I misreading the code?

Thx for all your feedback guys, I really appreciate it!

Stenyj