New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

url_session

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url_session

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

UrlSession

UrlSession stores your session in memcache (dalli), puts session_id to every url and parses it in midleware

Chrome url bar with UrlSession enabled

Installation

$ gem install url_session

Usage

Add gem to your Gemfile

gem 'url_session'

configure session_store to use url_session (session_store.rb)

UrlSessionExample::Application.config.session_store :url_session_store, :namespace => 'sessions',
  :key =>"_session", :compress => true, :expire_after => 1.day, :cookie_enabled => false, :param => 'session_id'

and include UrlSession in your ApplicationController

class ApplicationController < ActionController::Base
  include ControllerAuthentication
  protect_from_forgery

  include UrlSession::Controller
end

You can put your all routes in session_id scope, if you want (routes.rb)

scope "/(:session_id)" do
  resources :sessions
  resources :users
  resources :posts
  ...
  match '/'  => 'posts#index',   :as => :root # root :to => 'posts#index' doesn't work here
end

Options

The same like dalli_store plus:

:param => 'PHPSESSID'    # name of session id parameter, default 'session_id'
:cookie_enabled => false # try to use cookie before url, default true

Example

http://url-session-example.herokuapp.com

FAQs

Package last updated on 24 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc