# Session hash set from outside program?

**URL:** <https://www.ruby-forum.com/t/session-hash-set-from-outside-program/190331>\
**Category:** Rails\
**Created:** [June 17, 2010, 8:49pm UTC](https://www.ruby-forum.com/t/session-hash-set-from-outside-program/190331 "2010-06-17T20:49:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sindrig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@sindrig](https://www.ruby-forum.com/u/sindrig)\
**Post date:** [June 17, 2010, 8:49pm UTC](https://www.ruby-forum.com/t/session-hash-set-from-outside-program/190331/1 "2010-06-17T20:49:20Z")

</div>

Hi,  
I have had my new rails program up for a few days now. I’m running it on  
Ubuntu 10.4 with apache2 in another location than the website it’s made  
for (it’s a standalone database application for physiotherapists). The  
people I made it for now want me to deploy it to the public part of  
their website, only with one change. Those who open it via the link in  
the public-part should not be able to click one button!

I was thinking of doing something like this in my view:

\<% if session[:inside]%\>  
\<%=button\_to ‘SÃ¦kja mÃ¦litÃ¦ki’, @link\_to\_mt%\>  
\<%end%\>

How could I set session[:inside] only to true if the program was started  
from within the private part of the webpage? I thought of creating two  
new actions, the other would set session[:inside] to true and the other  
to false, but that seems to me like a security risk, is it not?

BR,  
Sindri
