gallery session problem

hi,

i have a album which password protected, my users could access it without any problem

but after i enable "gallery sessions", my users are being redirect at password login page even they have entered correct login and password.

please help, thx!

my platform:
zenphoto version 1.2.6 [4482]
nginx 0.6.32
php 5.2.6-1
debian 5.0

here is the log:
zp_getCookie(zenphoto_auth)::album_session=1; SESSION[]=, COOKIE=
Backtrace: checkAuthorization()
checkAuthorization called
from require_once (auth_zp.php [44])
from require_once (functions.php [127])
from require_once (template-functions.php [10])
from index.php [14]
checkAuthorization: admins => (
6 => ( id => 6, user => admin, pass => 1ad49a2731feaa9b2d23144a776eb89c,
name => , email => , rights => 81790, custom_data => a:6:{s:7:"website";s:0:"";s:6:"street";s:0:"";s:4:"city";s:0:"";s:5:"state";s:0:"";s:7:"country";s:0:"";s:6:"postal";s:0:"";},
valid => 1, group => ),
)
zp_setCookie(zenphoto_auth, , 1253443867, /)::album_session=1
zp_getCookie(dynamic_locale)::album_session=1; SESSION[]=, COOKIE=
zp_handle_password: $authType=zp_album_auth_f1981e4bd8a0d6d8462016d2fc6276b3; $check_auth=6abe2eb0c1081c5697d20b57cac089d1; $check_user=;
zp_handle_password: $post_user=; $post_pass=654321; $auth=6abe2eb0c1081c5697d20b57cac089d1;
zp_handle_password: valid credentials
zp_setCookie(zp_album_auth_f1981e4bd8a0d6d8462016d2fc6276b3, 6abe2eb0c1081c5697d20b57cac089d1, 1258995867, /)::album_session=1
/index.php?userlog=1&album=2009
zp_getCookie(zenphoto_auth)::album_session=1; SESSION[]=, COOKIE=
Backtrace: checkAuthorization()
checkAuthorization called
from require_once (auth_zp.php [44])
from require_once (functions.php [127])
from require_once (template-functions.php [10])
from index.php [14]
checkAuthorization: admins => (
6 => ( id => 6, user => admin, pass => 1ad49a2731feaa9b2d23144a776eb89c,
name => , email => , rights => 81790, custom_data => a:6:{s:7:"website";s:0:"";s:6:"street";s:0:"";s:4:"city";s:0:"";s:5:"state";s:0:"";s:7:"country";s:0:"";s:6:"postal";s:0:"";},
valid => 1, group => ),
)
zp_setCookie(zenphoto_auth, , 1253443867, /)::album_session=1
zp_getCookie(dynamic_locale)::album_session=1; SESSION[]=, COOKIE=
zp_handle_password: $authType=zp_album_auth_f1981e4bd8a0d6d8462016d2fc6276b3; $check_auth=6abe2eb0c1081c5697d20b57cac089d1; $check_user=;
zp_getCookie(zp_album_auth_f1981e4bd8a0d6d8462016d2fc6276b3)::album_session=1; SESSION[]=, COOKIE=
zp_getCookie(zenphoto)::album_session=1; SESSION[]=, COOKIE=
zp_getCookie(zenphoto_last_album)::album_session=1; SESSION[]=, COOKIE=
zp_getCookie(zenphoto_image_search_params)::album_session=1; SESSION[]=, COOKIE=
zp_getCookie(zp_album_auth_f1981e4bd8a0d6d8462016d2fc6276b3)::album_session=1; SESSION[01fbcfdf5eb343fe1176cad17afff283]=, COOKIE=
zp_getCookie(zenphoto_auth)::album_session=1; SESSION[]=, COOKIE=
Backtrace: checkAuthorization()
checkAuthorization called
from require_once (auth_zp.php [44])
from require_once (functions.php [127])
from require_once (template-functions.php [10])
from index.php [14]
checkAuthorization: admins => (
6 => ( id => 6, user => admin, pass => 1ad49a2731feaa9b2d23144a776eb89c,
name => , email => , rights => 81790, custom_data => a:6:{s:7:"website";s:0:"";s:6:"street";s:0:"";s:4:"city";s:0:"";s:5:"state";s:0:"";s:7:"country";s:0:"";s:6:"postal";s:0:"";},
valid => 1, group => ),
)
zp_setCookie(zenphoto_auth, , 1253443868, /)::album_session=1
zp_getCookie(dynamic_locale)::album_session=1; SESSION[]=, COOKIE=
zp_handle_password: $authType=zp_gallery_auth; $check_auth=; $check_user=;

Comments

  • Sessions seem to not be working on your installation. The PHP function `session_id()` is returning an empty string which indicates that there is no session. When `gallery sessions` is set the login information is stored with the session and not in a cookie, so sessions have to work.

    Guess you will have to disable this option.
  • hi,

    the problem in /zp-core/functions.php, around 123:

    if (getOption('album_session') && defined(OFFSET_PATH) && OFFSET_PATH==0 && session_id() == '') {
    session_start();
    }

    i found that OFFSET_PATH is not defined, so i modified to:
    if (getOption('album_session') && session_id() == '') {
    session_start();
    }

    gallery session does work, please advise if you need any more information to test the code, thx a lot!
  • Yes, please. OFFSET_PATH should be defined as 0 at index.php line 12. The OFFSET_PATH checks were to prevent setting sessions excpet for scripts rooted in the base index.php script.

    So please describe exactly what scripts are involved with your user logins.
  • hi sbillard,

    how could i check what scripts are involved when my user login?
    i just use zenphoto version 1.2.6 [4482] and i did not modify any code.
    thx fop help
  • You could set the `DEBUG_LOGIN` and report back the debug log output it makes. Are your users logging in to the back-end? If not, what are they viewing when they log in?
  • hi sbillard,

    sorry for my late come back.
    my users just login to front-end

    btw, after i upgrade to latest svn 2009-10-05, you have modified the code and now i have no problem to use the album password with session enabled, thanks.
  • I have found/fixed another problem that sometimes prevented login on the front end. In tonight's build.
Sign In or Register to comment.