Using APEX 5.02, Oracle 11g
I'm having a problem trying to understand and get the session state protection working for a link,
I have a PL/SQL block that creates an email with a link to the document. When the page protection is set to unrestricted the link in the email works fine. When I set the page to Must have Checksum and click on the link in the email I get a must set checksum. I am using the prepare_url and it is not setting the &cs value at the end. Below is the code which I shortened for brevity. I create the doc_link manually and then use the prepare_url. Using apex_debug I look to see what the output is. As you can see they are both the same. I searched the forum and google and tried about a dozen different things that others said but I am having no luck. Can anyone tell me what I am doing wrong? As I said when the page is unrestricted it works fine.
Thank you in advance for all assistance.
Lawrence
Debug output
DOC_LINK = https://ofmstage.rtpnc.epa.gov/apex/caedint/f?p=113:11:::::P11_RSVD_ID:28
SND_LINK = https://ofmstage.rtpnc.epa.gov/apex/caedint/f?p=113:11:::::P11_RSVD_ID:28
Application SSP is on

Page SSP is on

PL/SQL Code:
DECLARE
L_BODY CLOB;
...
l_wksp number;
CURSOR C1 IS
SELECT PROPERTY\_TAG,MANUFACTURER,
MODEL\_NUMBER,LOCATION,ROOM\_LEVEL,
CUST\_OFF\_NAME,CUST\_OFF\_EMAIL
FROM ERESERVE\_RSV\_DETAIL
WHERE RSVD\_ID = :P11\_RSVD\_ID
ORDER BY MANUFACTURER;
BEGIN
SELECT workspace_id
INTO l\_wksp
FROM apex\_workspaces
WHERE workspace = 'CAEDINT';
...
L_BODY := 'eReserve Reservation Information';
L_SUBJECT := 'eReserve Reservation Information';
DOC_LINK := 'https://' || :APP_SERVER_NAME || :APP_SERVER_FOLDER ;
DOC_LINK := DOC_LINK || '/f?p=' || :APP_ID || ':11:::::P11_RSVD_ID:' || :P11_RSVD_ID;
SND_LINK := APEX_UTIL.PREPARE_URL(p_url => DOC_LINK, p_checksum_type => 'SESSION');
apex_debug.message('DOC_LINK = %s%', DOC_LINK);
apex_debug.message('SND_LINK = %s%', SND_LINK);
L_BODY_HTML := '<html><head><title>eReserve Reservation Information</title></head>';
...
L_BODY_HTML := L_BODY_HTML || '</tbody></table>' || '<br>';
L_BODY_HTML := L_BODY_HTML || 'eReserve Record: <a href =' || SND_LINK || ' alt="eReserve Record">Click Here</a><br>';
apex_util.set_security_group_id (l_wksp);
APEX_MAIL.SEND(
p_to => L_SEND_TO,
p_from => 'CAEDeReserve@epa.gov',
p_body => L_BODY,
p_body_html => L_BODY_HTML,
p_subj => L_SUBJECT,
p_cc => :P11_RSVD_BY_EMAIL2,
p_bcc => '',
p_replyto => 'Do Not Reply');
APEX_MAIL.PUSH_QUEUE;
END;