When used as a session store, I noticed that redis-rails saves the session id in unencrypted format in the cookie. Shouldn't session id be treated as secure information and not be exposed in a cookie unencrypted to thwart session-hijacking attempts?
Is it secure to use redis-rails as session store?
1.3k Views Asked by RajeshT At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- Rails HABTM: Select everything a that a record 'has'
- Best way to make an HABTM association via console
- dynamically create an ical / ics file from a rails model
- Ruby destroy is not working? Or objects still present?
- NoMethodError: undefined method `update_average_rating' for nil:NilClass
- Select results where joined table contains records with an attribute, but without another
- Showing posts only created when boolean was true
- Ruby on rails and HAML - Print a hash with background color
- How can I monitor an endpoint's status with Ruby?
- How to create dynamic pages without form_for helper in Rails?
- Rails 4.2 jQuery loads only after refresh
- "Access Denied" - User's Permissions to S3 Bucket
- ActiveRecord, Rails 4: has_many :through with scoped conditions failure
- Rails - formatting a list of options
- Rails - Ajax do not work properly on production server
Related Questions in SESSION-COOKIES
- Internet explorer 11 browser cannot display the expires value of the session cookie from my app
- Server side PHP session is not working in android
- Can JWT be a replacement for session based authentication for web application?
- ActionDispatch nil value for env[ENV_SESSION_OPTIONS_KEY]
- Where does Jetty store information about authenticated user?
- How to use HTTP/2 connection instead of session cookies?
- Play Framework not setting cookie on initial page load
- How to add keep me logged in using PHP?
- How to achieve a persistent HTTP session in MATLAB?
- How to pass a modified or custom session while making request in testing flask applications?
- Multiple users with unique session IDs in jmeter
- $_SERVER['HTTP_COOKIE'] return's two PHPSESSID
- TokenMismatchException in VerifyCsrfToken.php line 53 in Laravel 5.1
- Very strange session issue with Opencart and PHP
- JSessionID changes on resource request after login which invalidates the session
Related Questions in REDIS-RAILS
- Is it secure to use redis-rails as session store?
- Redis search for keys with a value
- How to set the configuration for middleware for ActionDispatch::Session::RedisStore and Devise
- ROR SESSION STORE: Session store with :redis_store not getting cookie with session_id in it in response
- How do I implement connection pooling for Redis-As-Rails-Cache (using Redis as rails cache) Rails 4.1?
- Why doesn't Redis work with my Rails application?
- Vagrant+Ansible+Redis - Get 127.0.0.1:6379 (Errno::ECONNREFUSED) when using different servers
- with redis-rails, how to delete all but sessions cache?
- How to set maxmemory for RedisCloud addon on heroku ( rails app )?
- "IOError - closed stream" when using Paperclip with rails-redis
- Ruby On Rails, Redis::CommandError: ERR wrong number of arguments for 'set' command
- Websocket-rails and redis-rb do not restore Pub/Sub Channel on failover
- Issues with redis-rails and connection_pool
- Hiredis fails when deploying with capistrano
- Rails, Redis and Sentinel
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No.
The session identifier cookie is the only (decent) way to link a client to a session. The client must have some sort of claim which they can pass along with the request so that we can identify them.
This applies whether you are using CookieStore, Redis, ActiveRecord or memcached.
Encrypting the session identifier with a fixed salt or no salt would do absolutely nothing but waste time since the attacker has access to the cookie anyways in a man-in-the-middle or XSS attack.
If you used a salt you would have to link that to the user as well. Now you have two problems instead of one.
While you could use a bunch of novel approaches like salting with the user agent, ip or anything else that you think you know about the client the security benefits are few.
As @pvg said:
Meaningful ways to protect the session are:
reset_sessionwhen logging users in and out to avoid session fixation.