Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Session Management?

Reply
Thread Tools

Session Management?

 
 
Z Monteca
Guest
Posts: n/a
 
      12-01-2003
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
 
Reply With Quote
 
 
 
 
Malte Ubl
Guest
Posts: n/a
 
      12-02-2003
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

 
Reply With Quote
 
 
 
 
Z Monteca
Guest
Posts: n/a
 
      12-02-2003
Malte Ubl <(E-Mail Removed)> wrote in news:bqhphg$bka$(E-Mail Removed):

> 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
 
Reply With Quote
 
Z Monteca
Guest
Posts: n/a
 
      12-03-2003
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
 
Reply With Quote
 
Malte Ubl
Guest
Posts: n/a
 
      12-03-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'. Mike Larkin ASP .Net 1 05-23-2005 12:33 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM
Which is faster? Dim dv As New DataView(session("myDataTable")) or CType(session("myDataTable")) Andreas Klemt ASP .Net 1 07-23-2003 12:18 AM



Advertisments