Difference between revisions of "API:EPrints/DataObj/LoginTicket"
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> | <!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> | ||
==NAME== | ==NAME== | ||
− | '''EPrints::DataObj::LoginTicket''' - User system | + | '''EPrints::DataObj::LoginTicket''' - User system login ticket. |
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
Line 17: | Line 17: | ||
<!-- Pod2Wiki=head_description --> | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
− | Login tickets are the database entries for | + | Login tickets are the database entries for a user's session cookies. |
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
Line 153: | Line 153: | ||
The ID of the user to whom this login ticket belongs. | The ID of the user to whom this login ticket belongs. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_instance_variables --> | ||
+ | ==INSTANCE VARIABLES== | ||
+ | See [[API:EPrints/DataObj#INSTANCE_VARIABLES|EPrints::DataObj]]. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
Line 163: | Line 174: | ||
<!-- Pod2Wiki=head_methods --> | <!-- Pod2Wiki=head_methods --> | ||
==METHODS== | ==METHODS== | ||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_class_methods --> | ||
+ | ===Class Methods=== | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
<span style='display:none'>User Comments</span> | <span style='display:none'>User Comments</span> | ||
Line 171: | Line 191: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_get_system_field_info --> | <!-- Pod2Wiki=item_get_system_field_info --> | ||
− | ===get_system_field_info=== | + | ====get_system_field_info==== |
$fields = EPrints::DataObj::Access->get_system_field_info | $fields = EPrints::DataObj::Access->get_system_field_info | ||
Line 184: | Line 204: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_get_dataset_id --> | <!-- Pod2Wiki=item_get_dataset_id --> | ||
− | ===get_dataset_id=== | + | ====get_dataset_id==== |
$dataset = EPrints::DataObj::LoginTicket->get_dataset_id | $dataset = EPrints::DataObj::LoginTicket->get_dataset_id | ||
Line 197: | Line 217: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_get_defaults --> | <!-- Pod2Wiki=item_get_defaults --> | ||
− | ===get_defaults=== | + | ====get_defaults==== |
$defaults = EPrints::DataObj::LoginTicket->get_defaults( $session, $data, $dataset ) | $defaults = EPrints::DataObj::LoginTicket->get_defaults( $session, $data, $dataset ) | ||
Line 210: | Line 230: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_new_from_request --> | <!-- Pod2Wiki=item_new_from_request --> | ||
− | ===new_from_request=== | + | ====new_from_request==== |
$loginticket = EPrints::DataObj::LoginTicket->new_from_request( $repo, $r ) | $loginticket = EPrints::DataObj::LoginTicket->new_from_request( $repo, $r ) | ||
Line 225: | Line 245: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_expire_all --> | <!-- Pod2Wiki=item_expire_all --> | ||
− | ===expire_all=== | + | ====expire_all==== |
EPrints::DataObj::LoginTicket->expire_all( $repo ) | EPrints::DataObj::LoginTicket->expire_all( $repo ) | ||
Line 238: | Line 258: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_session_key --> | <!-- Pod2Wiki=item_session_key --> | ||
− | ===session_key=== | + | ====session_key==== |
EPrints::DataObj::LoginTicket->session_key( $repo ) | EPrints::DataObj::LoginTicket->session_key( $repo ) | ||
Line 258: | Line 278: | ||
</div> | </div> | ||
<!-- Pod2Wiki=item_secure_session_key --> | <!-- Pod2Wiki=item_secure_session_key --> | ||
− | ===secure_session_key=== | + | ====secure_session_key==== |
EPrints::DataObj::LoginTicket->secure_session_key($repo) | EPrints::DataObj::LoginTicket->secure_session_key($repo) |
Latest revision as of 17:10, 10 January 2022
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::DataObj::LoginTicket - User system login ticket.
DESCRIPTION
Login tickets are the database entries for a user's session cookies.
Configuration Settings
user_cookie_timeout = undef
Set an expiry on the session cookies. This will cause the user's browser to delete the cookie after the given time. The time is specified according to CGI's cookie constructor. This allows settings like +1h and +7d.
user_inactivity_timeout = 86400 * 7
How long to wait in seconds before logging the user out after their last activity.
user_session_timeout = undef
How long in seconds the user can stay logged in before they must re-log in. Defaults to never - if you do specify this setting you probably want to reduce user_inactivity_timeout to <1 hour.
CORE METADATA FIELDS
code (id)
The identifier used in the HTTP cookie for this login ticket's session.
securecode (id)
The identifier used in the HTTPS cookie for this login ticket's session.
ip (id)
The IP address of associated with this login ticket.
time (bigint)
The time in seconds since the start of epoch when this login ticket was created.
expires (bigint)
The time in seconds since the start of epoch when this login ticket will expires.
REFERENCES AND RELATED OBJECTS
userid (itemref)
The ID of the user to whom this login ticket belongs.
INSTANCE VARIABLES
See EPrints::DataObj.
METHODS
Class Methods
get_system_field_info
$fields = EPrints::DataObj::Access->get_system_field_info
Returns an array describing the system metadata of the loginticket dataset.
get_dataset_id
$dataset = EPrints::DataObj::LoginTicket->get_dataset_id
Returns the ID of the EPrints::DataSet object to which this record belongs.
get_defaults
$defaults = EPrints::DataObj::LoginTicket->get_defaults( $session, $data, $dataset )
Returns default values for this data object based on the starting $data.
new_from_request
$loginticket = EPrints::DataObj::LoginTicket->new_from_request( $repo, $r )
Creates a new loginticket data object using the HTTP::Request $r.
Returns new loginticket data object if successful. Otherwise, returns undef.
expire_all
EPrints::DataObj::LoginTicket->expire_all( $repo )
Expire all login tickets. Effectively logging out all users currently logged in.
session_key
EPrints::DataObj::LoginTicket->session_key( $repo )
Get the key to use for the session cookies.
In the following circumstance:
example.org custom.example.org
Where both hosts use the same cookie key the cookie from example.org will collide with the cookie from custom.example.org. To avoid this the full hostname is embedded in the cookie key.
secure_session_key
EPrints::DataObj::LoginTicket->secure_session_key($repo)
See session_key.
Object Methods
generate_cookie
$cookie = $loginticket->generate_cookie( %opts )
Returns the HTTP (non-secure) session cookie. Uses %opts to add any additional attributes to the cookie.
generate_secure_cookie
$cookie = $ticket->generate_secure_cookie( %opts )
Returns the HTTPS session cookie. Uses %opts to add any additional attributes to the cookie.
set_cookies
$ticket->set_cookies
Set the session cookies for this loginticket data object.
update
$ticket->update
Update the loginticket data object by extending the expiry time.
The expiry time is extended user_inactivity_timeout or 7 days.
SEE ALSO
EPrints::DataObj and EPrints::DataSet.
COPYRIGHT
© Copyright 2000-2024 University of Southampton.
EPrints 3.4 is supplied by EPrints Services.
http://www.eprints.org/eprints-3.4/
LICENSE
This file is part of EPrints 3.4 http://www.eprints.org/.
EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.
EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.