Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: GT::Session::File problems: Edit Log

Here is the list of edits for this post
GT::Session::File problems

I started using GT::Session::File module to manage sessions on my site.
Currently for some reasons, I don't want to use GT::Session::SQL, so please don't recommend me the SQL based session management.

I found that GT::Session::File module works strangely.
  1. there is no separate method to read the session data. Tough using data() method, data read is possible, I think there should be also need a data_read() method to just read session data.

  2. no correct method, to check existance of a session. Tough it is possible through this code:
    # Load a session
    my $session = new GT::Session::File ( $id ) or die "Can't load session: '$id'.";
    but this still creates new sessions for each case when we do checking call & session is missing. It's not fine to create a dummy session file, just because we wanted to check session existance.
    Yes, there could be possible to use if (-e $session_path/$session_id) for existance check, however why is the API if I have to do everything manually?
    I assume this is a bug or a lack of session check feature.

  3. The recommended way by doc is, to set directory path using this code:
    # Set session directory
    my $session = new GT::Session::File ( directory => '/path/to/sessions', id => $id );
    However it is bad, since creates new session file, which will be not used for anything.

    Recommended way should be:
    $GT::Session::File::DIRECTORY = $sessions_path;

  4. EDIT: One more bug: When printing out the session object using Dumper for debugging reasons, I see that the 'directory' value is missing, even if was previously set by $GT::Session::File::DIRECTORY = $sessions_path; code.
    The 'directory' value should be always the actual value of $DIRECTORY variable!

Did anybody else face such problems with GT::Session::File?

Alex, GT: do you plan improving the API interface of GT::Session::File in near future?

Best regards,

Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 8, 2003, 9:22 AM

Edit Log: