You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by raptor <ra...@unacs.bg> on 2001/10/10 09:46:49 UTC

objects via Session

hi,

How u transffer objects via Session, do U freeze it first (fe. Storable) and
then assign to Session variable OR U just assign it and Session-object do
the dirty work....

Thanx in advance
=====
iVAN
raptor@unacs.bg
=====


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: objects via Session

Posted by Joshua Chamas <jo...@chamas.com>.
raptor wrote:
> 
> hi,
> 
> How u transffer objects via Session, do U freeze it first (fe. Storable) and
> then assign to Session variable OR U just assign it and Session-object do
> the dirty work....
> 

Yes, just like this:

  # STORE
  $Session->{object} = $object;

  # FETCH
  my $object = $Session->{object};

Anything that is per process related like file handles & 
database connections will not survive the freeze, just raw data 
is OK.  Also note, if it will be a lot of data potentially, you 
will need to use a StateDB other than the default of SDBM_File.  
I would suggest MLDBM::Sync::SDBM_File or DB_File.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org