github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

neerajdotname / session_expiration_management

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.
  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

updated README 
Neeraj Singh (author)
Tue Aug 25 13:09:48 -0700 2009
commit  7f776173da88a35cb727b1caa853fb6ef4bac021
tree    dff0e770b0b3babf5b640d1d00a53e504e601d09
parent  32da8f0a00a807a4205f76f77b4f90d57e939130
session_expiration_management /
name age
history
message
file .gitignore Loading commit data...
file README.markdown
directory app/
directory config/
file init.rb
directory lib/ Sun Aug 23 11:03:56 -0700 2009 done [Neeraj Singh]
directory test/ Sun Aug 23 08:37:38 -0700 2009 first commit [Neeraj Singh]
README.markdown

SessionExpirationManagement

Introduction

Most of the bank sites log you out or allow you to extend your session if you are inactive for a while. This plugin provides an opportunity to user to extend his/her session before logging the user out.

depends on

jQuery 1.3+

Rails 2.3

Why I am not using some sort of modal box

When I use modal box then set_Timeout function doest not work properly. Until I find out how to fix that, this is the best I could do.

How to install

ruby script/plugin install git://github.com/neerajdotname/session_expiration_management.git 

Copy the javascript file to your application

cp vendor/plugins/session_expiration_management/lib/js/session_about_to_expire.js public/javascripts

Inside the head tag of your layout add following two lines

<%= javascript_include_tag 'session_about_to_expire' %>
<%= trigger_session_expiration_watch %>

In application_controller.rb add followling line

 manage_session_expiration(:logout_url => '/logout')

By default user will be logged out if user is inactive for 20 minuts. 2 minutes before that usre will be prompted to extend their session. If you want to override the default values then you can provide your values like this

manage_session_expiration(:logout_url => '/logout',
                          :keep_session_alive_for => 30.minutes,
                          :warn_user_when_time_left_is => 4.minutes)

Thie plugin assumes that view has access to method logged_in?. Usually I define this method like this in application_controller.rb

def logged_in?
  session[:user_id]
end
helper_method :logged_in?

Feedback

Email me: neerajdotname [at] gmail (dot) com

Author Blog

www.neeraj.name

Source Code

http://github.com/neerajdotname/session_expiration_management

License

MIT

Copyright (c) 2009 neerajdotname

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server