Ruby CGI Session
CGI::Session can save persistent session state for users and CGI environments. It needs to be closed after the session is used. This ensures that data is written to the storage. When the session is completed, you need to delete the data.
Access "/cgi-container/test.cgi?bgcolor=red" to hop to the page with the predefined foundation shading.
The session information exists in the transitory record catalog of the server. The prefix parameter indicates the prefix of the session and will be utilized as a prefix for the brief record. Along these lines you can without much of a stretch distinguish distinctive session transitory records on the server.
CGI::Session keeps up a tireless condition of client and CGI condition. The session can be in memory or on the hard drive.
The Ruby Class CGI::Session gives a simple method to make a session:
Enable another CGI session and return the relating CGI::Session object. The alternative can be a discretionary hash, which can be the accompanying qualities:
- session_key: The key name spare session defaults to _session_id.
- session_id: Unique session ID. Programmed generation
- new_session: If genuine, makes another Session id for the present session. Assuming false, utilize the current session ID with session_id. On the off chance that this parameter is precluded, the current session is utilized if accessible, generally another one is made.
- database_manager: The class used to spare sessions, which can be CGI::Session::FileStore or CGI::Session::MemoryStore. The default is FileStore.
- tmpdir: For FileStore, the wrong catalog for the session.
- prefix: For FileStore, the prefix for the session document.
|serial number||method description|
Returns the estimation of the given key. View the occasion.
Set the estimation of the given key. View the occasion.
Invoke the erase strategy for the basic database the board. For FileStore, erase the physical document containing the session. For MemoryStore, expel session information from memory.
Invoke the update strategy for the hidden database the board. For FileStore, compose the session to circle. No impact on MemoryStore.