# ActionController::Base's session attribute

**URL:** <https://www.ruby-forum.com/t/actioncontroller-bases-session-attribute/93021>\
**Category:** Rails\
**Created:** [April 26, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/actioncontroller-bases-session-attribute/93021 "2007-04-26T17:55:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpagas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@alpagas](https://www.ruby-forum.com/u/alpagas)\
**Post date:** [April 26, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/actioncontroller-bases-session-attribute/93021/1 "2007-04-26T17:55:02Z")

</div>

Hi there,

I’m working on a subclass of ActionController::Base which is implemented  
as  
a plugin. I need to store data in the superclass ‘session’ attribute,  
just  
as I would normally do in a regular controller.

For some unexplicable and unknown reason, the session object is not a  
Hash  
but an Array. That doesn’t make any sense… I don’t understand how the  
session object got converted as an Array…

I can’t find why, I’ve tried for a while and got out of options.

The plugin can be downloaded from :

svn://rubyforge.org/var/svn/actionflow

To tet it, just create a basic application and a test controller withe  
the  
following code :

class TestController \< ActionFlow::Base  
protected  
start\_step :init  
end\_step :close  
view\_step :init do  
#nothing for now…  
end  
end

–

* * *

Luc B.

---

<div class="post-metadata">

**Author:** ![alpagas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@alpagas](https://www.ruby-forum.com/u/alpagas)\
**Post date:** [April 26, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/actioncontroller-bases-session-attribute/93021/2 "2007-04-26T18:19:05Z")

</div>

Hi again !

I just realised that the problem is that sub-classes of  
ActionController::Base cannot directly use the session attribute of the  
super class. How can a subclass of ActionController::Base access the  
superclass CGI::Session object ?

Luc

Hi there,

I’m working on a subclass of ActionController::Base which is implemented  
as  
a plugin. I need to store data in the superclass ‘session’ attribute,  
just  
as I would normally do in a regular controller.

For some unexplicable and unknown reason, the session object is not a  
Hash  
but an Array. That doesn’t make any sense… I don’t understand how the  
session object got converted as an Array…

I can’t find why, I’ve tried for a while and got out of options.

The plugin can be downloaded from :

svn://rubyforge.org/var/svn/actionflow

To tet it, just create a basic application and a test controller withe  
the  
following code :

class TestController \< ActionFlow::Base  
protected  
start\_step :init  
end\_step :close  
view\_step :init do  
#nothing for now…  
end  
end

–

* * *

Luc B.

–

* * *

Luc B.
