mercredi 19 août 2015

How to retain value in session from one request to another in rails

I have a "theme_layout_id" variable that i store in session to get that from one request to another. (The last variable in hash)

{"_csrf_token"=>"JGLph2PFnv3iQqPO84bYaNZvbW4EqI2xneFv3fda4c4=", "theme_id"=>4, "theme_style_id"=>7,
  "sample_feed_user"=>#<User id: 202, email: "food@food.com", username: "food", client_id: 184, slug: "food",
   encrypted_password: "$2a$10$cipeV/AB6K0n1d6Oqp.oWuwChe.A.tJZvRIjvuJ71IuO...", reset_password_token: nil, reset_password_sent_at: nil,
    remember_created_at: nil, sign_in_count: 1, current_sign_in_at: "2015-08-06 19:03:40", last_sign_in_at: "2015-08-06 19:03:40", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2015-08-06 19:03:37", updated_at: "2015-08-06 19:04:44", superadmin: false, profile_pic_url: nil, can_publish: true,
   can_curate: true, signup_notify: true, remember_me: nil, intro_curate_completed: nil, intro_design_completed: nil>, "theme_layout_id"=>4}

but it keep on destroying when going for another controller request. Only this particular variable keep on lapsing, not others. What could be possible reason for this.

Aucun commentaire:

Enregistrer un commentaire