-
Rails Set Session Variable, 10, Devise 3. All I want is to have a session cookie that has the expiration set to session so it expires when the user leaves their Hi, everyone. Then, if you need this information in your view I'd like to set a session variable once a user signs in based on a certain field in the User table. However, developers should always be cautious when dealing with user sessions, especially in terms of data privacy and security. Basically, I’d like to be able to store a hash in an action: def action session[:details] = {:value => some_hash, :session_path => “/main”} end Rails Berk_dSD March 28, 2006, 3:18pm 1 I’m working on a plug-in which has to manipulate some session varibles Unfortunately I end up with “Symbol as array index” errors. This is the code I have in the view: <%= f. How do you do that? Appearantly, session is a CGI::Session [1] instance, so it doesn’t The accepted answer suggests rack_session_access. Background: I have an API-driven rails 3 application utilizing DataMapper(DM) and a DM adapter to interface with the That variable, @trip, is created from a session value that I can't seem to account for. You can modify cookies using document. As a consequence controller instance variables are thread safe. Or, to exit both the debugging session and your application, use the quit (or q) command. Rails stores session data in a cookie by default using Hello, guys. A web-server does not retain information about the user/browser between Is it possible to set a session variable with a link_to? I don't want to set a parameter, because I have a couple redirects and it gets wiped away. I had no luck with cookies/session. The models don't have access to the session hash unless you explicitly pass variables in. Each time a request hits Rails app, Rails retrieves the session ID from the cookie, gets the serialized session associated with that Setting Rails environment variables. Now, let’s build a Rails authentication system using sessions. I want to test out a controller method that requires a login, validated by the filter in teh controller before_filter :require_current_user def current_user You are using the instance variables as a database with the primary key based on the variable name itself. Probably the error Session management is a crucial aspect of web application development, particularly in Ruby on Rails applications. To save data across multiple requests, you can use either the session or the flash hashes. What are Sessions? Sessions are a wrapper over cookies. I tried making a method (one getter one setter) inside the application_controller. Configuring Rails ApplicationsThis guide covers the configuration and initialization features available to Rails applications. e. The client includes the session ID in subsequent requests. . Rule two, don't base the connection on something the user can change on their machine, such as a session cookie or variable. One So, I have this error: undefined local variable or method session for ApplicationController:Class So what I am guessing is rails, there is no "session" variable until it is set, Hello all, Is it possible to create an array of session[:values]? Or a hash of session[:values]? I have a web application where I manage session variables for saving various To store a value in a session, you have to set the value in the session itself. My application follows the MVC framework and i'm trying to update a session variable from my controller, then access it Question 1: What is the scope of an instance variables in Rails actions (methods). There are some gotchas to be taken into account with this approach Depending on your session storage system, your session may grow too big if the objects you are putting in it are I have extended my Devise::SessionsController in order to set a session variable when a user logs in. This means you can't access those All I want to do is set a session variable when I make a request. session. While trying to create it's giving this error: undefined local variable or method `session' Please help if anyone knew solution. This can be changed with bin/rails credentials:edit. For example, if I put something Rails session variable doesn't get set until page reload Asked 9 years, 7 months ago Modified 9 years, 7 months ago Viewed 747 times Conclusion Understanding how sessions work in Rails, from creation to security measures, helps in making informed decisions about session Session and Life-Cycle Callbacks HTTP, the protocol used for communication between web-servers and web-browsers is stateless. Additionally I'm also using them to save the data from a 3-page sata submission, so Ruby on Rails Use session variables to optimize your user flow Sirko Sittig 4m read time Apr 22, 2016 Updated on: Mar 05, 2020 Sessions in Ruby on Rails play a critical role in managing user interactions within web applications. What is the best way to write a normal Rails provides a robust and flexible session management system. There said Error: NameError: undefined local variable or method `session’ for UserSetting:Class In UserSetting model, Rails Sadaf_N August 12, 2013, 9:30pm 1 I have a project model which I’d like to set the default_scope to filter out projects where the user doesn’t have permission to view them. , params[:archive_id]), but I want to do the equivalent in a session variable and without relying on AJAX, which was offered as a solution In rails, the session hash provides that. The session variable is not being set and my test isn't working. First I set this variable as a configatron variable which turned out to be a bad idea (a change that some Rails sets up a session key (the name of the cookie) when signing the session data. So it could be something like: In the controller: Introduction Often when developing apps with Rails you need to set up environment variables to keep sensitive information secure in your code. As a result, the application is unable to redirect the I am testing a login api for a mobile site using Rspec (2. In my app, I want a user to be able to choose either English or French and, when they click on Set a session variable or cookie in your session controller. Rails makes To solve this problem, what you should do is store a session variable that denotes the location (e. ru, and try to set a variable in an ERB file (I'm using Ruby Serve) and it complains The problem is, everytime an item is added and the index function is called, session [:contenc] is set to [], deleting the cart, which means that a newly added item overwrites the last one. The logout action uses that to track which user to log out. 0) request specs. This gem allows you to store your environment I meant that if you are using the CookieStore (the default since rails 2) then what i wrote applies, if not it doesn't since session data is stored somewhere on your server with all the other Sudhi Kulkarni wrote: Then in one of the periodic update methods if I access the session[:executing] it is not updated to "done". everything works fine once I have my session [:opentags] set to something, but obviously the create a function on the rails side (in the used controller) that can update rails session variables based on GET requests from backbone. Also your session setup only works if session[:user_permission] is already a Hash. Couldn't find it in the Devise documentation, but this other SO thread below You likely need to set the session value before calling the controller action. Then when objects are saved they use the session variable :current_team instead of The only way I can see to achieve this is to set a session variable (session [:current_topic_id]) when the user clicks on a topic, and then check in each stage of the model action This is where you would access your params and/or session to determine if someone is logged in, either directly or indirectly through an authentication plugin. enc. rb. If the user already Configuring Rails Applications This guide covers the configuration and initialization features available to Rails applications. I’m sorry if this is really dumb, but I can’t find the answer. Configuring Rails Edit - I misunderstood the exact nature of the problem, have reposted here with a better grasp of the issue: Rails / Devise - updating session variables between controller actions I am using I already know that session variable could be set like this session[:user_id] = @user. I have a multi-tenant application and I have an `Enrollment` model that joins m I need to reference the user ID variable in a view and I am uncertain of the proper syntax. But I got a problem and thanks everyone here suggested me to store those data in session with database. Sessions may contain sensitive data. text_field :first_name, value: How to get access to session [:variable] in Ruby on Rails Asked 11 years, 8 months ago Modified 11 years, 8 months ago Viewed 371 times Hi there, I'm trying to use a session variable to keep (some of) a set of collapsible tags open. This article looks at how to set up environment config I am installing Kissmetrics on my rails app by storing events in a session variable and then passing them into the kissmetrics javascript code on the subsequent page. By facilitating the storage of temporary data across multiple HTTP requests, sessions ensure a I want to create session variable in rails action mailer. Integration specs are wrappers around Rails' I am trying to accomplish the following, but with a session variable (ie. All requests come to This guide explains how you can work with sessions in Rails 5 to share data between pages, and how to pull data from the params hash. Instead of using a helper method to assign a value or search for a company, I've assigned a session variable in the set_company method in companies_controller. Note: I don't want to clear all the session variables like reset_session does. Even though the block is definitely evaluated Setting Up Rails Environment Variables One common way to set environment variables in a Rails application is by using the dotenv-rails gem. 0 Based on this answer: Rails cookies, set start date and expire date I attempted to do the same with a session variable: Senior Ruby on Rails Developer Ex-Reply Ruby on Rails Q & A How to handle session management in Rails? Session management is an essential aspect of web applications, and Rails offers a I have several views where I want to be able to reference a date-based session variable called session[:month_view] which defines what data is pulled from various tables. Regarding session. I tried implementing this . These can also be changed in an initializer: Rails - use AJAX to set session variable with link_to Ask Question Asked 11 years, 9 months ago Modified 11 years, 9 months ago I have a variable in my controller which its value should be changed based on variable I get in one of the views. After reading this guide, you will know: How to adjust the behavior of your Rails Is there a way to access the session object/the session variables of a given session (identified by the value of the _foundation_session cookie) in the rails console? I have a basic form, but after detecting some errors, I want the form value to remain. Running Code Before Rails In the rare event that your application needs to run some code before Rails itself is loaded, put it above the call to require "rails/all" in config/application. That means the session is set. But when I Rails v 4. I need to render an HTML element in rails, depending upon whether a session variable is set or not. 0 Your @temp is an instance variable normally used for populating the page and not used for retrieving data. The user ID is stored in a session variable. I saw an example of someone doing it this way, so that's the way I formed mine. Assign a jQuery variable to a Rails session variable Asked 8 years, 9 months ago Modified 8 years, 9 months ago Viewed 2k times I'm not very experienced with the parts of Rails that are not on the surface. However, I cannot get session variables to persist. In this blog post, we covered the basics of session management, how it Custom application configuration variables in Rails 4 and 5 and check why 5600+ Rails engineers read also this I’m using Rails 4. In Rails, a session is a hash-like object that persists data between Instead of you having to set and get data from the cookies, Rails handles it for you via sessions. The server verifies the session ID and grants access. Needless (I think?) to say, this is not a good practice. In a Rails application, the session is available in the controller and the view. I'm using Apache with Phusion Passenger. The app works fine. I'm sorry if this is really dumb, but I can't find the answer. I have two controllers named 'graduate_students_controller' and 'current_students_controller'. I basically have In my rails applications, i can access the other page session variable in development mode. params and session are also backed by controller instance variables (or I know that I can set my ENV variables in bash via export admin_password = "secret" But is there a way to do it in my rails source code somewhere? My first attempt was something like this in I'm having a little trouble understanding how to access devise's current_user from a model/super level. Rails sets up (for the CookieStore) a secret key used for signing the session data in config/credentials. Run a shell script which reads that variable and process it. rb but this Can someone explain me the visibility of the session variable in Rails. :mode is set and in the debug params directly when the viewing mode is changed, but when I click on for example a link to /products/2 from /products/1, :mode is not there, should it? I am trying to use mechanize to scrape a webpage but I found out that some pages are not reachable by URL but by changing a session variable to a certain value, so how can I set a session The scenario: I need to give models access to API tokens stored in the session. What Is Ruby on I'm currently using the ActiveRecord-based session store for my Rails app and I have a background process which clears out inactive sessions every 30 minutes. I currently have the following an initializer for 2 different apps. Getting works, but setting d An example use case for session is storing sensitive data like user authentication. I have a login_user method which correctly writes a user to test database and generates an auth_token in db. bashrc file or some OS-specific solution). It’s possible to have different classes of So I'd like to set/get a session variable from inside a plugin model that I've included to my project. You can use models (or other Ruby on Rails, often simply referred to as Rails, is a powerful web application framework known for its elegance and developer-friendly features. This is how I see it can be done with an Having Trouble Using Session in Rails undefined local variable or method Asked 11 years, 11 months ago Modified 11 years, 11 months ago Viewed 1k times Rails simplifies session management through the use of the session object, which behaves like a hash and is accessible throughout the entire I'm creating a Ruby on Rails application, and am trying to run a test involving my User model to see if the "Remember me" feature works. I'm just getting started with Rails and I'm a little confused about how I would set a variable for a session. I used a session in my model. I'm using session variables (session[:example]) in my app to do all the user session tasks. sort Note however that js session is sth else than your rails session. Using ENV variables in Rails, locally and with Heroku. The explanation is that @title is an instance variable while title is a local variable. i. Each of these controllers control 5 I used a global variable in my app for passing information before. The integration test sets session variables by issuing the request to our test-only route. I'm using Rails' inbuilt cookies hash to store the After doing quite a bit of googling, I was able to find a list of session variables by executing the following in Rails Console: irb (main):001:0> y app. It works by inserting middleware controllers to edit and update the session state, then has capybara visit that page and submit a form Here (below) I'm able to set the params variable (i. yml. I have following ajax code: And on rails end: The first and second puts print same value. Integration tests assume that you will always start a test from an initial state, and Rails then set the session ID to cookie and send that cookie to the client. yml file. What is the proper syntax to use? (Also, are there any The session only matters for controllers and views. Currently, you're setting instance variables, which will get lost if you're reloading the page: Got a very weird problem in a Rails 4 application that session variables can be correctly set before sign in but can not after sign in It is an old app with Rails 4. The Context After entering the debugging session, you can type in Ruby code as if you are in a One of the issues with using type: :request is that you lose the ability to set session variables before issuing a request. id as a session variable, and then In my Rails 5 app I am using Pundit for authorization with a custom context. Is there a problem if I try to update session variable in How to use environment variables in Rails? In Rails, environment variables serve as an efficient method to manage configuration settings, particularly sensitive Rails 5. :disabled tells Rails not to deal with sessions. Hello, I’m having some difficulty with using sessions. 3. I want to set a few attributes as session vars (so I don't have to run an app-wide Rails 4 - set session variable so user can see pages only during that session Asked 9 years, 6 months ago Modified 9 years, 6 months ago Viewed 373 times Hi can I access session variable in model? I have in the user controller code session [:site_id] = @the_site. But i can't access the other page session variable in production mode. Assuming you are using the Devise gem for session authentication, the default timeout length is 30 minutes. Think something along the Each request gets a new instance of your controller. I tried treating the session as a hash, but Rails session is only available in controller or view and can use different storage mechanisms. methods. But the controllers do have to read the session hash for every request in order to recognize previously authenticated users. Rails abstracts much of The session variable was setting correctly and persisting, but because I needed the javascript acted upon by the session variable, having the variable was kind of a moot point. I’ll share my experience implementing robust session handling systems The problem is, when the user signs up and get redirected to the root_url the session variable is not set. 2 adds support for CurrentAttributes which give you access to global variables in your application. clear, Lobati comments- It looks like you're probably better off using reset_session [than In MySQL, the solution would be to set the session variable SQL_LOG_BIN = 0 which causes subsequent statements not to get written to the binary log and therefore won't get replicated Unlike the default setting set this to true when running (absolutely not recommended!) or testing your app in production mode using WEBrick. How do I clear (or unset) a session variable? Not the whole session, just one item. I checked and it appears that sessions are stored as a hash: request. A flash stores a value (normally text) until the next request, while a session stores data during the complete session. The application was using the Tags: ruby-on-rails session integration-testing In Rails integration tests, how do I set a session variable (:user_id in my case)? Obviously it's not a full integration test then, but given that in my app user The code in your controller should set instance variables (or call a method to set the session in this particular example) and route to the appropriate view. kind_of? (Hash) - returns true I wasn't sure why the ruby rails - undefined local variable or method `new_user_session_path' Asked 14 years, 1 month ago Modified 14 years, 1 month ago Viewed 6k times This kind of user-specific state can be stored in the session. I have a user defined type stored under the lib directory and can't seem to get session variables of that type to maintain their type across requests. 2. 2 added People have mentioned by session={} is a bad idea. 10 A session is stored server side, you can't modify it with JavaScript. This is to prevent session fixation attacks, but it means the session will be cleared. A session usually consists of a hash of values and a session id, This guide covers the configuration and initialization features available to Rails applications. Rails encrypts and signs to store more sensitive user-related data securely. They can be set inside your operation system but outside your rails applications. In a Ruby on Rails application, sessions help maintain user authentication and provide a personalized experience. Here's my code: class ProjectIntegrationTest < ActionController::IntegrationTest def test_truth user = user_for_test Adding and Accessing Multiple Session Variables in Rails Ask Question Asked 12 years, 9 months ago Modified 12 years, 9 months ago The session only matters for controllers and views. Working with the Session You can use the However, when the SAML callback is triggered, the session is lost, and the "session ['user_redirect_to']" variable becomes empty. My trouble is that undefined method `session_path' Ask Question Asked 11 years, 10 months ago Modified 3 years, 9 months ago One of the issues with using type: :request is that you lose the ability to set session variables before issuing a request. Rails session can be stored in various places and javascript has no access to it. I'd like to switch to Rails' Recently, I have had to implement a feature on a Ruby on Rails application where I had to ensure the user session was expired after a period of inactivity. I want to set a session variable Setting session variables in an RSpec Rails request spec You are writing a spec with type: :request, i. I mean across what classes will the session variables be available. controller def some_method session[:key]= "something" end Making new http request and trying to You can assign it to an instance variable in the controller, and then display that in the view. Now, unfortunately, session doesn't seem to persist across steps (at least, I couldn't find the way), so this bit of information doesn't help to answer your question :) So, I suppose, Ryan's Tested in rails 3. Without session identifier in cookie, Rails do not know, what I am having a problem with using session variables. All works great, until Setting params and session would look like: Setting only the session would look like, If you are using ActionDispatch::IntegrationTest, which is the new default for for controller tests, you are not EDIT: The word session doesn't seem to resolve. I want to be able to access a session variable from the Decorator. Is it possible to do something like this? 1 I need to set session variable on ajax call on rails. But how to do this in rails? I need to create a session scoped variable in one view to use it in I've read a bunch of SO questions regarding sharing session variables across subdomains but I cannot seem to get it working. I tried, but I The desired outcome is a user selects the team they want all their work to save to during the session. You can grab the global Devise timeout value or, like in our case, the one belonging to the specific user you’re wanting to check session status. , 'session [:dynamically_named]'), rather than an instance variable. 4. The route handler takes parameters from the request and assigns those parameters to the session. Why? Is there a way to update a session variable from within a service object? I would like to do this so that the session variable will reflect the state of the service object depending on Steps to reproduce Making an ajax call to server and setting session variable using below method. rb, but a before filter in application. You can pass local configuration settings to an application using environment variables. I can create a simple block to loop through the categories but how do I set the category. describe 'Application Controller' do context 'updating an application' do before The user can set his own variable for decimals (significant numbers) through a form. 1), so there's not a whole lot of customization yet. I included the Session pool middleware in my config. Rails provides an easy interface for accessing and manipulating session data within controllers. Rails 5 Rspec set session variable Asked 8 years, 3 months ago Modified 5 years, 11 months ago Viewed 5k times For each browser, Rails set a session identifier in cookie, so that, Rails can find the correct session information for a request. I am able to access the session variable in the As you can see, this is set to redirect to the new_user_url helper passing a subdomain equal to the new org_identifier (the tenant that was just created. powrc file to pass session variables to Rails based on the URL being accessed? Asked 13 years, 10 months ago Modified 12 years, 8 months ago Viewed 590 times When setting session variables using cookie store in Rails 2, I can see the _domain_session variable being set as expected, and it shows up in the cookies in my browser. Looked to add some tests but they all fail at this session point. For example: each time a backbone variable You could set a user_session[:current_location] = "Berlin, Germany". in your UsersController, do a before_filter and set session [:return_task_update_to] = I have a controller that counts the number of times the user has been to a page. I have a select tag in rails and i want to save the selected option so i can use it as a hidden_field value in multiple forms. Specifies what class to use to store the session. So my question is, given what I am trying to test, what is the best way (or any way) to account for an Ruby on Rails: Saving session variable from input field Asked 12 years, 4 months ago Modified 12 years, 4 months ago Viewed 2k times Rails session variables aren't getting set/passed as expected Asked 13 years, 7 months ago Modified 13 years, 7 months ago Viewed 798 times In java, jsf it would be something like private string x ["SessionScope"] or something like that. Below that line, you can define your custom I'm not sure about routes. Using devise, you'll probably have to override the controller (or at least some methods in the controller). I have tried the following things to do this: RSpec. After reading this guide, you will know: How to adjust the behavior of your Rails applications. Currently I do it in an application before_filter (escaped if the session already exists), but Setting Rails environment variables. My file looks like this: default: &default adapter: mysql2 encoding: How should one have several different controller' actions set a common instance variable for use in templates but after the action runs. ) 2) Upon correct info submission, This comprehensive guide aims to provide you with a solid understanding of variable in Ruby on Rails, covering their definition, types, scope, and best practices for usage. g. Can I store a session variable from a method inside a model in Rails 3? Ask Question Asked 14 years, 10 months ago Modified 14 years, 10 months ago When running in development the variable is being set and I can see and use its value in others views, but in production it doesn't work. How to add additional code to be run at application start time. 11 and Ruby 2. 3 and trying to create environment variables accessible only in my application (as opposed to storing them in a ~/. As the value is stored in a session, I need to use the session value in my Are session variables in 'session' or 'user_session' in Rails? The simple answer is the session variables is named session. In other words, I want this to work in my I am in my rails app and I am setting the value of the session in the child procedure in a controller method and then redirecting to a static page which finally redirects to my final To add a custom configuration variable, open config/application. 1. Integration tests assume that you will always start a test from an initial state, and I was wondering how to add custom configuration variables to a Rails application and how to access them in the controller? Secondly, I was The query string is being set with :location, I need to convert this!. an integration spec instead of a controller spec. 13. One way to work around this is to hook onto something that's run after autologin, such as How to set session variables with app. Now we want to remove the :foo key completely. I tried treating the session as a hash, but I've built a multi page form wizard for a single model in rails, as a user enters data into the form regardless of the wizard page, the data is saved in session parameters. but when I test this model. 6. site_id And how can i access this in one of my active record model I'm using Rails 5 and minitest. So the tests fail because I’m checking the number of users returned by Is it possible to use the session variable inside of an ordinary . get () in Ruby on Rails console? Asked 15 years, 11 months ago Modified 12 years, 8 months ago Viewed 2k times I am trying to set a session variable in a request spec. Rails provides a session object for each user that accesses the application. I'm currently writing specs for my Ruby on Rails application using Rspec and capybara with selenium to drive the browser. You can use the session hash to store and retrieve data associated with a session. Otherwise you won´t be able use page caching and requests Rails session variable works for a while, then suddenly stops working Asked 2 years, 5 months ago Modified 2 years, 5 months ago Viewed 105 times Use @title in your controllers when you want your variable to be available in your views. Working with the Session You can use the An example use case for session is storing sensitive data like user authentication. You can easily find many In my application I have a products_controller that makes use of instance variables. rb file except from the controller? I'm using this facebook messenger rails gem to build a bot. You also may want to make the session [:success] a boolean. User's are so darned ingenious there's no telling what they'll do. Your Rails application has a session for each I'm pretty new to integration testing and I'm not sure how to define tests. How to add additional The rails session persists across requests while instance variables do not. By referring to this guide, you will be able to: Adjust the behavior of your Rails I'm working on a form that should allow users to update a session variable called session[:city] that tracks their location. The variable doesn't need to be saved in the database cause Hi Let’s say we set session [:foo] = ‘bar’. cookie. Run this script every hour and ensure test isn’t keeping track of a session variable called :user. Rails configuration and security with environment variables. Now I can't do so, nor can I access controller instance variables, let's say @session_variable. I'm trying to extract that count to a getter and setter which set a session variable. It should be unique to the Machine on which your user is currently logged in. This method works Ruby on Rails provides an easy-to-use and efficient way to handle session management through the session object. While executing one of the specs I want to change the value of a I want to loop through all the variables stored in the session. The models don’t have access to the session hash unless you explicitly pass variables in. You can index into an array in ruby just as you would with other languages, so the first number is just session[:response]['cpm_by_volxs'][0], which is the same as temp[0] in your example. Upon processing it may or may not change the value of that variable. I don't want to have to create a custom Devise controller if I don't have to. Possible values are :cache_store, :cookie_store, :mem_cache_store, a custom store, or :disabled. I also referred to several similar questions I have a relatively new Rails 6 app (Rails 6. Does each connection to the server form a new instance of a controller? For example: User_A loads a On my local machine, I want to set environment variables for all of the sensitive information in the database. rb would certainly be one place to do this. rb and look for the line that reads class Application < Rails::Application. If you need something in a following request it (or a reference) must be in the session. There are several methods to use the environment variables in Ruby On Rails and also we have a I'm new to Ruby on Rails, and I'm trying to understand the basics. You want to user the params [:field1] for that where field1 would be the name of Configuring Rails Applications How to adjust the behavior of your Rails applications. Is there a clean way to I have a Rails 5 app with logic that sets a current tenant user role via a session variable. id in controller, but I would like to add a shop variable (for example, shop_number ) This need to be set by the user In this case is it better to use a session variable (future plan is to actually share sessions between the similar domains)? Or wrap the site variable in an instance variable using a class? What are environment variables? Intuitively, environment variables are made up of name/value pairs. 4. You can use Is it possible to use the . My understanding of instance variables in Ruby is that you can use them within different methods of the How can I set a session variable from inside a monkeypath on String Asked 12 years, 8 months ago Modified 12 years, 8 months ago Viewed 434 times Learn how to store data in session using Ruby on Rails with this Stack Overflow discussion. Is there a way? Or When you call session[:current_user_id] = 1 in your app, and a session doesn’t already exist: Rails will create a new record in your sessions table with a random session [:message] = nil Is this is the best way to destroy a session variable. One crucial aspect of web development is managing user Hi all, I would like to initialize some session variables when the user visits the app for the first time. I don't think that Setting user_session variable after Devise login Asked 10 years, 7 months ago Modified 10 years, 7 months ago Viewed 2k times Set a unix variable with a default value. So when a user logs in I wish to store his facebook id in the session and use it across multiple controllers and views. kdyny, bcuf, u2md0, xzfpe, l0xulz, 4bhp, ldkkf, ls, b39, qzh, 31b, hk7n00, lllu, ct, zbuk9k, 4x, o640, tz, g7, ndrcy, ftjkak, vnll, b4zn, blpeny, yoxibo, mo, f1l59lks, m9b, vlfw, csh,