Forum: Ruby on Rails Sessions Problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F9e36e746e6dd7fe69c595c56796c5c3?d=identicon&s=25 Kumar (Guest)
on 2006-04-27 16:27

Hi to group!

I am new to ROR!

I am facing problems on sessions.

First I created the  one session variable.


after that I created the other one.

after  moving  to three pages the session  was  destroyed automatically.


What is the reason please help me!

Thnaks and Regards,
-Kumar Varma
D90ef6808433e63203e15a5c2dadb0bb?d=identicon&s=25 Ben Reubenstein (Guest)
on 2006-04-27 16:46
(Received via mailing list)
Is one of your pages overwriting the values?  You might try:

<%= debug session %>

In your main layout to watch what is happening to the session.

~ Ben

On 4/27/06, Kumar <Kumar@gmail.com> wrote:
>
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Ben Reubenstein
http://www.benr75.com
F9e36e746e6dd7fe69c595c56796c5c3?d=identicon&s=25 Kumar (Guest)
on 2006-04-28 06:47
Ben Reubenstein wrote:
> Is one of your pages overwriting the values?  You might try:
>
> <%= debug session %>
>
> In your main layout to watch what is happening to the session.
>
> ~ Ben
>
> On 4/27/06, Kumar <Kumar@gmail.com> wrote:
>>
>>
>>Dear Sir! Please resoleve this problem

  I tryed with this in the main layout


In First Page


--- !ruby/object:CGI::Session
data: &id001
  flash: !map:ActionController::Flash::FlashHash {}

dbman: &id002 !ruby/object:CGI::Session::PStore
  hash: *id001
  p: !ruby/object:PStore
    abort: false
    filename:
./script/../config/../tmp/sessions//ruby_sess.80c276a05c5f63ec
    rdonly: false
    table:
    transaction: false
dbprot:
- *id002
new_session: true
session_id: 85a794d70db26e657042b6cf5e676cbb
write_lock: true



In Second page also  same

but we are creating other session is i.e sessiuon[:username]

In third page

--- !ruby/object:CGI::Session
data: &id001
  :username: admin
  :checking:
  flash: !map:ActionController::Flash::FlashHash {}

dbman: &id002 !ruby/object:CGI::Session::PStore
  hash: *id001
  p: !ruby/object:PStore
    abort: false
    filename:
./script/../config/../tmp/sessions//ruby_sess.2f5da197f2fc548f
    rdonly: false
    table:
    transaction: false
dbprot:
- *id002
new_session: false
session_id: 62971ba072a87e78cbd7f0ee2630ab79
write_lock: true

Thanks and Regards,

Kumar






>>
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>> _______________________________________________
>> Rails mailing list
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
>
> --
> Ben Reubenstein
> http://www.benr75.com
36df5a25b0f7e1a39826370b91497167?d=identicon&s=25 Charles Leeds (Guest)
on 2006-04-28 16:23
(Received via mailing list)
Kumar wrote:
>> On 4/27/06, Kumar <Kumar@gmail.com> wrote:
> --- !ruby/object:CGI::Session
>     table:
>     transaction: false
> dbprot:
> - *id002
> new_session: true
> session_id: 85a794d70db26e657042b6cf5e676cbb

> --- !ruby/object:CGI::Session
> ./script/../config/../tmp/sessions//ruby_sess.2f5da197f2fc548f
>
>>> _______________________________________________
>
>

I am having the same problem.  I figured out it is due to having
multiple rails apps on the same hostname mybox.mydomain.com.  Each Rails
app is overwriting the session variable of the other Rails app.  Here is
the solution.

http://wiki.rubyonrails.com/rails/pages/HowtoChang...
77fd7eb6eca0f1c423670e7616b15277?d=identicon&s=25 Mahmoud M'hiri (mrom)
on 2007-03-10 09:51
> I am having the same problem.  I figured out it is due to having
> multiple rails apps on the same hostname mybox.mydomain.com.  Each Rails
> app is overwriting the session variable of the other Rails app.  Here is
> the solution.
>
> http://wiki.rubyonrails.com/rails/pages/HowtoChang...


I have the same problem but i'm working on localhost and i have only one
started application. I don't know why after visiting some pages,
sessions values are destroyed.

Help please!
This topic is locked and can not be replied to.