Description
Fetch a ticket for a user A for appending to an URL and sending in an email. Using this URL will automatically login A.
Examples
[%// Creating a login link that is valid for a maximum of 7 days:
$login_url = url(".login?" . ticket($some_user_name));%]
[%// Create a link to a service with the formal name %reply% to
// allow the email recipient to reply with single click and confirmation.
$ticket = ticket($user, new DateInterval("P2D"));
$reply_url = url("reply?inquiry=5759&" . $ticket);%]
|
Parameters4
Coding name |
user
|
Position |
1
|
Type |
Mixed(Primitive type)
|
Comments |
Accepts a string holding the username. Or a tobject representing a user account or a user. A user is something connected to a user account by the predefined association type.
|
See also |
www.topincs.com/…anual/usermanagement#user
|
Introduced in |
Topincs 8.2.0
|
Coding name |
valid_until
|
Position |
2
|
Type |
|
Default value |
7 days.
|
Comments |
- A %DateInterval% is added to now. It is the *maximum lifetime* of the ticket. If a ticket already exists that expires a sixth earlier than demanded, it suffices and will be resused. So for a year, that is approximately two months.
- No tolerance is applied to a %DateTime%. It must be valid to exactly that date.
|
See also |
www.topincs.com/issues/9619
|
Coding name |
sticky
|
Description |
Whether the ticket remains in the browser address bar after being used.
|
Position |
3
|
Type |
Boolean(Primitive type)
|
Default value |
False. The ticket is not sticky.
|
Comments |
- If users need to bookmark or share the URL, it is recommended to make the ticket sticky.
- For some user groups it makes sense to give them only access via tickets. They might be even unaware of their username and password. Then, if they bookmark the page of a non-sticky ticket, they will be challenged after revisiting the page once they closed their browser or the session expired.
|
Coding name |
stateless
|
Description |
If the client just sends a single request, e.g. a foreign system requesting or providing information via HTTP.
|
Position |
4
|
Type |
Boolean(Primitive type)
|
Default value |
False. The ticket creates a session.
|
|