Posts

Showing posts from February, 2011

Two cookie attributes you MUST be aware to secure your web app

There are two attributes of cookies that every web developer must be aware of to secure your web application. These two attributes doesn't save your application from all attacks, but at least they reduce the vulnerability to a great extent. These two attributes are: HttpOnly Secure The first attribute HttpOnly says that the cookie is intended to be passed only as a part of HTTP communication. Hence it must not be available to the application (like JavaScripts running in the browser). So once you load a page, if you type "javascript:alert(document.cookie)" in the URL bar, you will not those cookies that have the HttpOnly flag set. The second attribute Secure tells that the cookie should be sent as a part of the request if and only if the communication happens over a HTTPS channel. Typically login requests are sent over HTTPS channels. (If you are using a web app that is using HTTP for login page, its time you stop using it!). Typically, as a part of the login response

Cygwin and irb

If you had tried to start irb in Windows that has cygwin installed, you might have got the following exception trace: C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2095:in `expand_path': non-absolute home (ArgumentError) from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2095:in `_rl_read_init_file' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2078:in `rl_read_init_file' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:2499:in `readline_initialize_everything' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:3730:in `rl_initialize' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:4737:in `readline' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/readline.rb:40:in `readline' from C:/Ruby192/lib/ruby/1.9.1/irb/input-method.rb:115:in `gets' from C:/Ruby192/lib/ruby/1.9.1/irb.rb:139:in `block (2 levels) in eval_input' from C:/Ruby192/lib/ruby/1.9.1/irb.r