# Access to session object when creating a behavior

**URL:** <https://www.ruby-forum.com/t/access-to-session-object-when-creating-a-behavior/100797>\
**Category:** Radiant CMS\
**Created:** [August 1, 2006, 5:07am UTC](https://www.ruby-forum.com/t/access-to-session-object-when-creating-a-behavior/100797 "2006-08-01T05:07:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmorris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6f9a4e/32.png) [@jsmorris](https://www.ruby-forum.com/u/jsmorris)\
**Post date:** [August 1, 2006, 5:07am UTC](https://www.ruby-forum.com/t/access-to-session-object-when-creating-a-behavior/100797/1 "2006-08-01T05:07:11Z")

</div>

I am still learning Ruby, Rails, and Radiant, but I am trying to  
develop a new behavior for a custom application that extends Radiant.

I see that have access to request and response objects in the  
BaseBehavior, but do I have access to the session object?

I want to make all pages aware of the logged in user, but I am not  
sure how to go about doing this with Radiant.

Appreciate any help…

---

<div class="post-metadata">

**Author:** ![jsmorris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6f9a4e/32.png) [@jsmorris](https://www.ruby-forum.com/u/jsmorris)\
**Post date:** [August 3, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/access-to-session-object-when-creating-a-behavior/100797/2 "2006-08-03T12:02:00Z")

</div>

jsmorris wrote:

> 

You should have access to the session on the request object. Use the  
session method.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![jsmorris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6f9a4e/32.png) [@jsmorris](https://www.ruby-forum.com/u/jsmorris)\
**Post date:** [August 3, 2006, 12:04pm UTC](https://www.ruby-forum.com/t/access-to-session-object-when-creating-a-behavior/100797/3 "2006-08-03T12:04:23Z")

</div>

On 02/08/2006, at 1:02 PM, John W. Long wrote:

> jsmorris wrote:
> 
> > I see that have access to request and response objects in the  
> > BaseBehavior, but do I have access to the session object?
> 
> You should have access to the session on the request object. Use the  
> session method.

The session is disabled in SiteController, line 4:

session :off

remember to remove that line before playing with the sessions.

Bodhi
