# Story Runner with session problems

**URL:** <https://www.ruby-forum.com/t/story-runner-with-session-problems/133692>\
**Category:** Ruby\
**Created:** [April 2, 2008, 5:27pm UTC](https://www.ruby-forum.com/t/story-runner-with-session-problems/133692 "2008-04-02T17:27:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karnirevuri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/838e76/32.png) [@karnirevuri](https://www.ruby-forum.com/u/karnirevuri)\
**Post date:** [April 2, 2008, 5:27pm UTC](https://www.ruby-forum.com/t/story-runner-with-session-problems/133692/1 "2008-04-02T17:27:27Z")

</div>

Hi Friends,

I’m having the session handling issue in story runner.

Small description about my applications and problem

My application was integrated with single sign on (SSO) application.

Both applications are developed in rails (SSO, Normal application (i.e  
second))

If any user logged into sso application he can directly access the  
second application.

If any one try to access the second application , it will automatically  
redirect to sso application (i.e login page).

I have written the stories successfully for sso application.

but when we write the stories to second application we getting the  
problems regarding session.

I.e in my application every controller having before\_filter  
:login\_required which was defined in the plugins(in both applications)

We are checking the sessions and cookies in the method

When we call the actions from second application , it checking the  
sessions and cookies but it don’t find anything

so we are getting the problem

we have tried directly to assign the session variables in given block of  
story

i.e request.session[‘current\_user’] = User.find(1)  
controller.stub!(:login\_required).and\_return(@user)  
template.stub!(:login\_required).and\_return(@user)

We did’t solve this issue in stories ,

(FYI we have solved this issue in rspecs using the  
controller.stub!(:login\_required).and\_return(@user))

main problem is we are unable to access the session variables in the  
story (i.e in the when block)

Please give your ideas
