|
Hi everyone, how are yall doing?
I am developing a system where upon login (valid username and password) a session is started.
$session = new CGI::Session("driver:File", undef, {Directory=>"/tmp"});
$cookie = $cgi->cookie(CGISESSID => $session->id);
print $cgi->header( -cookie=>$cookie );
I want to check at top of every page if the session is still valid or the user has logged out. If the user has logged out they should be redirected to the login.pl page.
$sid = $cgi->cookie("CGISESSID") || undef;
$session = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
My concern is if someone has logged out, or the CGISESSID cookie is not set at all and if some one creates a cookie with name CGISESSID (using tools like firefox webdeveloper too) they could not be granted access.
I have been trying to fix this for 2-3 days but its just not happening
I would really apprecite if you could provide me with the script for creating session after successful login and validating this session at everypage.
Thankyou all for your prompt help and concern.
-Rakesh Gupta
|