Session Management?

Discussion in 'Perl Misc' started by Z Monteca, Dec 1, 2003.

  1. Z Monteca

    Z Monteca Guest

    I just did an implementation of sessions. Personally I used
    Apache::Session::File, but I see others have used CGI::Session. Does
    anyone have any pros/cons they could lend on using this method/module for
    management.

    So far the one problem that I have run into is all the garbage clean I up
    that has to be done. For every web request that is made it seems to create
    a lot of unecessary session files in the session directory (after a few
    hours I have upwards of 10's of thousands, but only have a few thousand
    hits a day ~2,000). I am not sure why this is. A true con is that you have
    to have run a cron script to clean up this directory every few hours. Is
    this a standard element of using the Apache::Session::File module or is my
    implementation seem to be messed up a bit?


    -Z
    Z Monteca, Dec 1, 2003
    #1
    1. Advertising

  2. Z Monteca

    Malte Ubl Guest

    Z Monteca wrote:

    > I just did an implementation of sessions. Personally I used
    > Apache::Session::File, but I see others have used CGI::Session. Does
    > anyone have any pros/cons they could lend on using this method/module for
    > management.
    >
    > So far the one problem that I have run into is all the garbage clean I up
    > that has to be done. For every web request that is made it seems to create
    > a lot of unecessary session files in the session directory (after a few
    > hours I have upwards of 10's of thousands, but only have a few thousand
    > hits a day ~2,000). I am not sure why this is. A true con is that you have
    > to have run a cron script to clean up this directory every few hours. Is
    > this a standard element of using the Apache::Session::File module or is my
    > implementation seem to be messed up a bit?



    Apache::Session defines an interface to be extended with other backend
    storage machanims. I like Apache::Session::CacheAny that uses the
    Cache::Cache interface. This enables you to use in memory cache which
    might be more appropriate for you.

    malte
    Malte Ubl, Dec 2, 2003
    #2
    1. Advertising

  3. Z Monteca

    Z Monteca Guest

    Malte Ubl <> wrote in news:bqhphg$bka$:

    > Z Monteca wrote:
    >
    >> I just did an implementation of sessions. Personally I used
    >> Apache::Session::File, but I see others have used CGI::Session. Does
    >> anyone have any pros/cons they could lend on using this method/module
    >> for management.
    >>
    >> So far the one problem that I have run into is all the garbage clean
    >> I up that has to be done. For every web request that is made it
    >> seems to create a lot of unecessary session files in the session
    >> directory (after a few hours I have upwards of 10's of thousands, but
    >> only have a few thousand hits a day ~2,000). I am not sure why this
    >> is. A true con is that you have to have run a cron script to clean up
    >> this directory every few hours. Is this a standard element of using
    >> the Apache::Session::File module or is my implementation seem to be
    >> messed up a bit?

    >
    >
    > Apache::Session defines an interface to be extended with other backend
    > storage machanims. I like Apache::Session::CacheAny that uses the
    > Cache::Cache interface. This enables you to use in memory cache which
    > might be more appropriate for you.
    >
    > malte
    >


    This sounds much more appropriate. Session::File is horrible. I am going
    to check out Session::CacheAny. Thanks for the insights.

    -Z
    Z Monteca, Dec 2, 2003
    #3
  4. Z Monteca

    Z Monteca Guest

    I have this problem with trying to implement Apache::Session::CacheAny.
    Everytime I tie the session:

    tie %session, 'Apache::Session::CacheAny', $id, {
    CacheImpl => 'Cache::SizeAwareFileCache',
    Namespace => 'bookstore',
    DefaultExpiresIn => '12 hours',
    AutoPurgeOnGet => 0,
    AutoPurgeOnSet => 1,
    MaxSize => 10_000,
    };

    no matter what I change the DefaultExpiresIn time to, my session variables
    last max two minutes? Does anybody have any idea why this is happening?

    Also, to use a persistent session, I would have to essentially tie %session
    in every file where I want this session to exist, correct?

    Thanks in advance.

    -Z
    Z Monteca, Dec 3, 2003
    #4
  5. Z Monteca

    Malte Ubl Guest

    Z Monteca wrote:
    > no matter what I change the DefaultExpiresIn time to, my session variables
    > last max two minutes? Does anybody have any idea why this is happening?


    No, I'm sorry

    > Also, to use a persistent session, I would have to essentially tie %session
    > in every file where I want this session to exist, correct?


    I don't know what you are referring to. My projects usually only have a
    single front end file, that instatiates the controller of the application.

    The code that instantiates your session can be loaded in via require or
    use just like any other code.

    bye
    malte
    Malte Ubl, Dec 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Smythe
    Replies:
    3
    Views:
    1,227
    Jeff Smythe
    Jan 2, 2004
  2. Floris van Haaster

    Project management / bug management

    Floris van Haaster, Sep 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,231
    Jon Paal
    Sep 23, 2005
  3. pouet
    Replies:
    2
    Views:
    737
    Will Hartung
    Jul 30, 2004
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,252
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Jazzis
    Replies:
    2
    Views:
    233
    Jazzis
    Sep 23, 2003
Loading...

Share This Page