Session Management?

Z

Z Monteca

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
 
M

Malte Ubl

Z said:
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
 
Z

Z Monteca

Malte Ubl said:
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

Z Monteca

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
 
M

Malte Ubl

Z said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top