4.10 SEND_LOGIN_USERNAME_COOKIE Procedure

This procedure sends a cookie with the username.

Syntax

send_login_username_cookie (
    p_username in varchar2,
    p_cookie_name in varchar2 default c_default_username_cookie,
    p_consent in boolean default false );

Parameters

Table 4-7 APEX_AUTHENTICATION.SEND_LOGIN_USERNAME_COOKIE Procedure Parameters

Parameters Description

p_username

The user's name.

p_cookie_name

The cookie name which stores p_username in the browser.

p_consent

Control if the cookie should actually be sent. If true, assume the user gave consent to send the cookie. If false, do not send the cookie. If there is no consent and the cookie already exists, the procedure overwrites the existing cookie value with null.

Example

The example code below could be from a page submit process on a login page, which saves the username in a cookie when consent is given. P101_REMEMBER_USERNAME could be a switch. On rendering, it could be set to Y when the cookie has a value.

apex_authentication.send_login_username_cookie (
     p_username => :P101_USERNAME,
     p_consent  => :P101_REMEMBER_USERNAME = 'Y' );