[rt-users] Using the RT %session global variable

Todd Chapman todd at chaka.net
Mon Jul 27 13:26:33 EDT 2009


I'm trying to store some temporary data is the %session variable,
similar to the way attachments are handled. (In fact I am working on
AJAX attachment uploading using Uploadify: http://www.uploadify.com/ )

Here is a small RT component I wrote to play with %session:

<pre>
<% Dumper $session{Foo} %>
</pre>
% $m->abort;
<%INIT>
use Data::Dumper;
my $num = rand(1000000);
$session{Foo}{ $num } = $num;
</%INIT>


No matter how many times I call it $session{Foo} only ever has 2
key/value pairs. Here is the output from 3 consecutive calls:

$VAR1 = {
          '940781.303899698' => '940781.303899698',
          '603827.532884804' => '603827.532884804'
        };

$VAR1 = {
          '284271.614611484' => '284271.614611484',
          '603827.532884804' => '603827.532884804'
        };

$VAR1 = {
          '629885.66885177' => '629885.66885177',
          '603827.532884804' => '603827.532884804'
        };


Is there anything special I need to do to store data in %session?

Any advice is appreciated.



More information about the rt-users mailing list