CKSession

Class/Module:
Class
In:
lib/cgikit.rb
Parent:
Object

Description

A class for session management. CKSession objects have a hash of arbitary objects and information about browser name, IP address, etc. However, you can’t set objects that can’t be marshal ( IO, Proc, etc. ) to the session with default database manager CKSessionStore::FileStore.

Programming Topics

Methods

[]
[]=
clear
clear?
create_session_id
fetch
new
remote_addr?
remove
session_id?
store
timeout?
user_agent?

Attributes

creation_time [RW]
Creation time of the session.
last_accessed_time [RW]
Last accessed time for the session.
remote_addr [RW]
IP address.
session [RW]
A hash of arbitary objects.
session_id [RW]
Session ID.
user_agent [RW]
Name of browser.

Public Class Methods

create_session_id()
new( session_id = nil )
session_id?( session_id )

Public Instance Methods

[]( key )

Alias for fetch

[]=( key, value )

Alias for store

clear()
clear?()

Returns true if "clear" method of the session is called.

fetch( key )
remote_addr?( remote_addr )

Returns true if the IP address is equal to one when the session created.

remove( key )
store( key, value )
timeout?( timeout )

Returns true if the session isn’t expired.

user_agent?( user_agent )

Returns true if the browser is equal to one when the session created.