|
From: Chris W. <ch...@cw...> - 2002-04-10 13:36:52
|
Accidentally hit 'reply' instead of 'reply to all'... -----Forwarded Message----- From: Chris Winters <ch...@cw...> To: Jure Simsic <jur...@li...> Subject: Re: [Openinteract-help] Authorisation problem Date: 10 Apr 2002 08:29:34 -0400 On Wed, 2002-04-10 at 07:10, Jure Simsic wrote: > Hi, I'm just starting with OI and have installed a vanilla site. The > problem I have is tahat whenever I follow a link my login info is gone, > I get the login window again and when I login again, tha page gets > displayed as it should. In error log I get: > > OpenInteract::UI::Main::handler (41) >> Action died. Here is what it > left: <div align="center"> > > <h1>Task is Forbidden</h1>... > > In my server.ini I have: > [session_info] > class = Apache::Session::Postgres > expiration = +3M > params = > expires_in = 0 > cache_user = 30 > cache_group = 30 > cache_theme = 30 > > Can anyone point me in the right direction? It sounds like your sessions aren't working or your browser isn't accepting cookies. Are there any error messages in the log ($WEBSITE_DIR/log/error_log_modperl) to indicate that the cookies aren't being saved? Such a message would be toward the end of a request. You might also look in the 'sessions' table in your DB to see if there are entries there. Walking through this thread might also help: http://sourceforge.net/mailarchive/forum.php?thread_id=536803&forum_id=3223 Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Jure S. <jur...@li...> - 2002-04-12 09:57:41
|
I have the same problem still. As I'm trying to dig out the problem I've
checked sessions in postgres and it seems that a session is written out
the first time i log in:
oi=# SELECT * from sessions ;
-[ RECORD 1
]-+------------------------------------------------------------------------------
id | 53273012796ad85a6a327ab7213feffd
a_session |
BQQDAAAAAQogNTMyNzMwMTI3OTZhZDg1YTZhMzI3YWI3MjEzZmVmZmQAAAALX3Nlc3Npb25faWQ=
last_accessed |
The table structure seems ok (according to
Apache::Session::Store::Postgres):
oi=# \d sessions
Table "sessions"
Attribute | Type | Modifier
---------------+-----------+----------
id | char(32) | not null
a_session | text |
last_accessed | timestamp |
Index: sessions_pkey
And with DEBUGging turned to 2 I get this errors in my modperl log:
Found item: Apache::DBI::db
(eval) (252) >> Trying to use cookie class: OpenInteract::Cookies::Apache
OpenInteract::Cookies::Apache::parse (21) >> Getting cookie session to
532730127
96ad85a6a327ab7213feffd
(eval) (254) >> Cookies in: $VAR1 = {
'session' => '53273012796ad85a6a327ab7213feffd'
};
(eval) (255) >> Trying to use session class: OpenInteract::Session::DBI
OpenInteract::Session::DBI::_create_session (26) >> Trying to fetch
session 53273012796ad85a6a327ab7213feffd
OpenInteract::Session::parse (32) >> Retrieved session properly: $VAR1 = {
'_session_id' => '53273012796ad85a6a327ab7213feffd'
};
OpenInteract::Auth::user (63) >> No uid found in session. Finding login
info.
OpenInteract::Auth::user (72) >> Creating the not-logged-in user.
OpenInteract::Auth::group (256) >> No logged-in user found, not
retrieving groups.
What does this mean? Also, is it ok not to have last_accessed field in
sessions empty? Are there be any other tables where session info gets
written (or not) to check?
Jure
Chris Winters wrote:
> On Wed, 2002-04-10 at 07:10, Jure Simsic wrote:
>
>>Hi, I'm just starting with OI and have installed a vanilla site. The
>>problem I have is tahat whenever I follow a link my login info is gone,
>>I get the login window again and when I login again, tha page gets
>>displayed as it should. In error log I get:
>>
>>OpenInteract::UI::Main::handler (41) >> Action died. Here is what it
>>left: <div align="center">
>>
>><h1>Task is Forbidden</h1>...
>>
>>In my server.ini I have:
>>[session_info]
>>class = Apache::Session::Postgres
>>expiration = +3M
>>params =
>>expires_in = 0
>>cache_user = 30
>>cache_group = 30
>>cache_theme = 30
>>
>>Can anyone point me in the right direction?
>>
>
> It sounds like your sessions aren't working or your browser isn't
> accepting cookies. Are there any error messages in the log
> ($WEBSITE_DIR/log/error_log_modperl) to indicate that the cookies aren't
> being saved? Such a message would be toward the end of a request. You
> might also look in the 'sessions' table in your DB to see if there are
> entries there.
>
> Walking through this thread might also help:
>
> http://sourceforge.net/mailarchive/forum.php?thread_id=536803&forum_id=3223
>
> Chris
>
>
|
|
From: Chris W. <ch...@cw...> - 2002-04-12 12:13:31
|
On Fri, 2002-04-12 at 05:55, Jure Simsic wrote:
> I have the same problem still. As I'm trying to dig out the problem I've
> checked sessions in postgres and it seems that a session is written out
> the first time i log in:
> ...
> And with DEBUGging turned to 2 I get this errors in my modperl log:
>
> Found item: Apache::DBI::db
> (eval) (252) >> Trying to use cookie class: OpenInteract::Cookies::Apache
> OpenInteract::Cookies::Apache::parse (21) >> Getting cookie session to
> 532730127
> 96ad85a6a327ab7213feffd
> (eval) (254) >> Cookies in: $VAR1 = {
> 'session' => '53273012796ad85a6a327ab7213feffd'
> };
>
> (eval) (255) >> Trying to use session class: OpenInteract::Session::DBI
> OpenInteract::Session::DBI::_create_session (26) >> Trying to fetch
> session 53273012796ad85a6a327ab7213feffd
> OpenInteract::Session::parse (32) >> Retrieved session properly: $VAR1 = {
> '_session_id' => '53273012796ad85a6a327ab7213feffd'
> };
Ah, here's the issue. There should be a 'user_id' entry in here, as the
log says...
> OpenInteract::Auth::user (63) >> No uid found in session. Finding login
> info.
> OpenInteract::Auth::user (72) >> Creating the not-logged-in user.
> OpenInteract::Auth::group (256) >> No logged-in user found, not
> retrieving groups.
>
> What does this mean? Also, is it ok not to have last_accessed field in
> sessions empty? Are there be any other tables where session info gets
> written (or not) to check?
No, this is the only session table. Can you delete this cookie (or
delete the session from the database) and login again, with DEBUG still
set to 2. You should get a message before the session is created/saved
telling you what's in the session.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Jure S. <jur...@li...> - 2002-04-12 12:34:25
|
Here'tis:
+++++
OpenInteract::Session::save (113) >> Saving new session
$VAR1 = {
'user_id' => '1',
'_oi_cache' => {
'group_refresh_on' => '1018616127',
'theme_refresh_on' => '1018614417',
'theme' => bless( {
'parent' => '0',
'description' => 'Your
basic, parent of all themes. Main.',
'title' => 'main',
'credit' =>
'OpenInteract Developers <in...@op...>',
'theme_id' => '1'
}, 'Hisa::Theme' ),
'user_refresh_on' => '1018616127',
'group' => [
bless( {
'notes' => 'Super
group, can do anything',
'group_id' => '1',
'name' => 'admin'
}, 'Hisa::Group' )
],
'user' => bless( {
'first_name' => 'Super',
'user_id' => '1',
'title' => undef,
'language' => 'en',
'last_name' => 'User',
'password' =>
'FTA656mFxR/LQ',
'num_logins' => undef,
'theme_id' => '1',
'removal_date' => undef,
'notes' => undef,
'last_login' => undef,
'email' =>
'adm...@si...',
'login_name' => 'superuser'
}, 'Hisa::User' )
},
'_session_id' => '1f1371e8e525455823c78843bb724d70'
};
OpenInteract::Cookies::Apache::bake (36) >> Setting session to value
1f1371e8e525455823c78843bb724d70
(eval) (273) >> Cookies out: session = 1f1371e8e525455823c78843bb724d70
+++++
But when I follow another link, I get again:
+++++
(eval) (255) >> Trying to use session class: OpenInteract::Session::DBI
OpenInteract::Session::DBI::_create_session (26) >> Trying to fetch
session 1f1371e8e525455823c78843bb724d70
OpenInteract::Session::parse (32) >> Retrieved session properly: $VAR1 = {
'_session_id' => '1f1371e8e525455823c78843bb724d70'
};
OpenInteract::Auth::user (63) >> No uid found in session. Finding login
info.
OpenInteract::Auth::user (72) >> Creating the not-logged-in user.
OpenInteract::Auth::group (256) >> No logged-in user found, not
retrieving groups.
+++++
and at the end:
+++++
(eval) (273) >> Cookies out:
OpenInteract::cleanup (425) >>
Errors: $VAR1 = [
bless( {
'user_id' => 99999,
'user_msg' => undef,
'code' => 305,
'filename' =>
'/usr/local/share/perl/5.6.1/OpenInteract/Handler/GenericDispatcher.pm',
'system_msg' => undef,
'session_id' => '1f1371e8e525455823c78843bb724d70',
'referer' => 'http://hisa.simsic.org/ObjectActivity/',
'url' => '/Security/',
'line' => 148,
'notes' => '8<br>
listing<br>
Hisa::Handler::Security<br>
1<br>
',
'package' => 'OpenInteract::Handler::GenericDispatcher',
'browser' => 'Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:0.9.8) Gecko/20020214',
'type' => 'n/a',
'error_time' => '2002-04-12 14:27:44',
'action' => 'n/a'
}, 'Hisa::ErrorObject' )
];
+++++
It seems it forgets about the ID instantly. Where is the ID info stored?
In sessions.a_session field?
I'm kinda lost here..
Tnx
Jure
Chris Winters wrote:
> On Fri, 2002-04-12 at 05:55, Jure Simsic wrote:
>>What does this mean? Also, is it ok not to have last_accessed field in
>>sessions empty? Are there be any other tables where session info gets
>>written (or not) to check?
>>
>
> No, this is the only session table. Can you delete this cookie (or
> delete the session from the database) and login again, with DEBUG still
> set to 2. You should get a message before the session is created/saved
> telling you what's in the session.
>
|
|
From: Chris W. <ch...@cw...> - 2002-04-12 13:08:27
|
On Fri, 2002-04-12 at 08:34, Jure Simsic wrote:
> Here'tis:
>
> +++++
> OpenInteract::Session::save (113) >> Saving new session
> $VAR1 = {
> ...
Ok, this looks great.
> OpenInteract::Cookies::Apache::bake (36) >> Setting session to value
> 1f1371e8e525455823c78843bb724d70
> (eval) (273) >> Cookies out: session = 1f1371e8e525455823c78843bb724d70
And so does this. But...
> +++++
>
> But when I follow another link, I get again:
>
> +++++
> (eval) (255) >> Trying to use session class: OpenInteract::Session::DBI
> OpenInteract::Session::DBI::_create_session (26) >> Trying to fetch
> session 1f1371e8e525455823c78843bb724d70
> OpenInteract::Session::parse (32) >> Retrieved session properly: $VAR1 = {
> '_session_id' => '1f1371e8e525455823c78843bb724d70'
> };
This is the problem. For some reason the session isn't coming back
properly.
Let's try to isolate this. What happens when you do something like the
following. (This is off the top of my head, so you may need to debug.)
---
use strict;
use Apache::Session::Postgres;
use Data::Dumper qw( Dumper );
use OpenInteract::Startup;
my $WEBSITE_DIR = '/set/this/to/path/to/site';
my $SESSION_ID = '1f1371e8e525455823c78843bb724d70';
{
my $R = OpenInteract::Startup->setup_static_environment(
$WEBSITE_DIR );
my ( %session );
tie %session, 'Apache::Session::Postgres',
$SESSION_ID, { Handle => $R->db };
print Dumper( \%session );
}
---
Later,
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Jure S. <jur...@li...> - 2002-04-12 13:16:11
|
Apart from first not being able to write to tmplib, I got:
$ perl test/test2.pl
Hisa::User::_class_initialize (15) >> Set Hisa::User to use crypt (1)
$VAR1 = {
'_session_id' => 'd90e4e7bb6458ebb69ae8fa9c330e341'
};
(i deleted my session and reinitialized it in between, so the ID is right)
Any clues?
Jure
Chris Winters wrote:
>
> Let's try to isolate this. What happens when you do something like the
> following. (This is off the top of my head, so you may need to debug.)
>
> ---
> use strict;
> use Apache::Session::Postgres;
> use Data::Dumper qw( Dumper );
> use OpenInteract::Startup;
>
> my $WEBSITE_DIR = '/set/this/to/path/to/site';
> my $SESSION_ID = '1f1371e8e525455823c78843bb724d70';
>
> {
> my $R = OpenInteract::Startup->setup_static_environment(
> $WEBSITE_DIR );
> my ( %session );
> tie %session, 'Apache::Session::Postgres',
> $SESSION_ID, { Handle => $R->db };
> print Dumper( \%session );
> }
> ---
|
|
From: Chris W. <ch...@cw...> - 2002-04-12 14:36:25
|
On Fri, 2002-04-12 at 09:15, Jure Simsic wrote:
> Apart from first not being able to write to tmplib, I got:
>
> $ perl test/test2.pl
> Hisa::User::_class_initialize (15) >> Set Hisa::User to use crypt (1)
> $VAR1 = {
> '_session_id' => 'd90e4e7bb6458ebb69ae8fa9c330e341'
> };
>
> (i deleted my session and reinitialized it in between, so the ID is right)
>
> Any clues?
The next step would be to create a brand new session in the test script,
then retrieve that same session from the test script to see if it works
ok.
AFAIK, I haven't seen any other problems with Postgres and
Apache::Session. What versions of PostgreSQL, DBI, DBD::Pg and
Apache::Session are you using?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Jure S. <jur...@li...> - 2002-04-15 08:05:02
|
Chris Winters wrote:
> On Fri, 2002-04-12 at 09:15, Jure Simsic wrote:
>
>>Apart from first not being able to write to tmplib, I got:
>>
>>$ perl test/test2.pl
>>Hisa::User::_class_initialize (15) >> Set Hisa::User to use crypt (1)
>>$VAR1 = {
>> '_session_id' => 'd90e4e7bb6458ebb69ae8fa9c330e341'
>> };
>>
>>(i deleted my session and reinitialized it in between, so the ID is right)
>>
>>Any clues?
>>
>
> The next step would be to create a brand new session in the test script,
> then retrieve that same session from the test script to see if it works
> ok.
>
So I did:
--
use strict;
use Apache::Session::Postgres;
use Data::Dumper qw( Dumper );
use OpenInteract::Startup;
my $WEBSITE_DIR = $ENV{OIWEBSITE};
#my $SESSION_ID = 'd90e4e7bb6458ebb69ae8fa9c330e341';
my $SESSION_ID = undef;
{
my $R = OpenInteract::Startup->setup_static_environment(
$WEBSITE_DIR );
my ( %session );
tie %session, 'Apache::Session::Postgres',
$SESSION_ID, { Handle => $R->db };
$SESSION_ID = $session{'_session_id'};
print Dumper( \%session );
untie %session;
tie %session, 'Apache::Session::Postgres',
$SESSION_ID, { Handle => $R->db };
print Dumper( \%session );
}
--
and I get:
perl test2.pl
Hisa::User::_class_initialize (15) >> Set Hisa::User to use crypt (1)
$VAR1 = {
'_session_id' => '80611dd437ef713d76bafe5997d3d7af'
};
$VAR1 = {
'_session_id' => '80611dd437ef713d76bafe5997d3d7af'
};
What kind of result should I be expecting?
> AFAIK, I haven't seen any other problems with Postgres and
> Apache::Session. What versions of PostgreSQL, DBI, DBD::Pg and
> Apache::Session are you using?
>
perl -MDBD::Pg -e' print $DBD::Pg::VERSION,"\n"'
1.01
perl -MApache::Session -e' print $Apache::Session::VERSION,"\n"'
1.54
postgresql-7.0.3
j-)
|
|
From: Jure S. <jur...@li...> - 2002-04-15 10:41:50
|
Chris Winters wrote:
> On Fri, 2002-04-12 at 09:15, Jure Simsic wrote:
>
> The next step would be to create a brand new session in the test script,
> then retrieve that same session from the test script to see if it works
> ok.
>
Btw, if i do something like:
tie %session, 'Apache::Session::Postgres',
$SESSION_ID, { Handle => $R->db };
$SESSION_ID = $session{'_session_id'};
$session{'key_size'} = length($SESSION_ID);
print Dumper( \%session );
untie %session;
print "\nRetrieving session:\n";
tie %session, 'Apache::Session::Postgres',
$SESSION_ID, { Handle => $R->db };
print Dumper( \%session );
untie %session;
..it does return me the extra supplied value ( $session{'key_size'} ):
$VAR1 = {
'_session_id' => 'ae95a09eba71452658364aa7d1aee1d7',
'key_size' => 32
};
Retrieving session:
$VAR1 = {
'_session_id' => 'ae95a09eba71452658364aa7d1aee1d7',
'key_size' => 32
};
So it seems as Apache session somewhat works..
j-)
|