- $cookie->{ 'PAGE' } = 'login' if not $cookie->{ 'SESSION_ID' };
- $cookie->{ 'PAGE' } = 'login' if $cookie->{ 'SESSION_ID' } ne $ENV{ 'SSL_SESSION_ID' };
- $cookie->{ 'PAGE' } = 'login' if not exists $session->{ $cookie->{ 'USER' } };
- $cookie->{ 'PAGE' } = 'login' if $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ne $cookie->{ 'SESSION_ID' };
+ # if ( $cookie->{ 'SESSION_ID' } )
+ # {
+ # if ( $cookie->{ 'SESSION_ID' } ne $ENV{ 'SSL_SESSION_ID' } ) {
+ # $cookie->{ 'PAGE' } = 'login';
+ # print STDERR "HER1"; # DEBUG
+ # }
+ # }
+ # else
+ # {
+ # $cookie->{ 'PAGE' } = 'login';
+ #
+ # print STDERR "HER2"; # DEBUG
+ # }
+
+ if ( exists $session->{ $cookie->{ 'USER' } } and $cookie->{ 'SESSION_ID' } )
+ {
+ if ( $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ne $cookie->{ 'SESSION_ID' } ) {
+ $cookie->{ 'PAGE' } = 'login';
+ print STDERR "HER3"; # DEBUG
+ }
+ }
+ else
+ {
+ $cookie->{ 'PAGE' } = 'login';
+ print STDERR "HER4"; # DEBUG
+ print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'SESSION_ID' }; # DEBUG
+ print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'USER' }; # DEBUG
+ print STDERR "NO SESSION USER\n" if not exists $session->{ $cookie->{ 'USER' } }; # DEBUG
+ }