Using the sessions manually

Understanding Using the sessions manually

Using the sessions manually

Let’s understand Using the sessions manually.  The importance of the data carried in the session needs to be assessed.  Further, protection may deploy.  However, this typically comes at a price, such as reduced convenience for the user. So, for instance, to protect users from a simple social engineering tactic, session.use_only_cookies needs to be enabled. Therefore, in that scenario, cookies must be enabled unconditionally on the client-side, or else sessions will not work.

To clarify, the terms user session refers to a series of user application interactions that tracks the server. Sessions are useful for maintaining user-specific state. Moreover, this includes persistent objects and authenticated user identities, among many interactions. So, for instance, a session could be used to track a validated user login followed by a series of directed activities for a particular user.

Not to mention, the session itself resides in the server. Therefore, for each request, the client transmits the session ID in a cookie or, if the browser does not allow cookies. Further, the server automatically writes the session ID into the URL.

The Sun ONE Application Server supports the servlet standard session interface, called HttpSession, for all session activities.

This interface enables you to write portable, secure servletsFor ultimate control, you can instantiate and use a Session manually.

require ‘capybara’

session = Capybara::Session.new(:webkit, my_rack_app)

session.within(“//form[@id=’session’]”) do

session.fill_in ‘Email’, :with => ‘[email protected]

session.fill_in ‘Password’, :with => ‘password’

end

session.click_button ‘Sign in’

Make your resume stand out and become a Certified Capybara Testing Professional. Try free practice tests here!

A great career is just a certification away. So, practice and validate your skills to become a Certified Capybara Testing Professional.

Calling Remote Servers
Understanding Selectors

Get industry recognized certification – Contact us

keyboard_arrow_up