Why I can't get cookie value in a new window?
Hi,
I created a before header prcessing:Login_Automatic in order to get the user name and password in cookie. The Source of Process is :
-----------------------------
declare
v varchar2(255) := null;
l_username varchar2(100);
l_password varchar2(100);
c owa_cookie.cookie;
begin
c := owa_cookie.get('LOGIN_USERNAME_COOKIE');
l_username := c.vals(1);
c := owa_cookie.get('LOGIN_PASSWORD_COOKIE');
l_password := c.vals(1);
--:CHECK_LOGIN_PW_EXIST := 0;
if l_username is not null and l_password is not null then
wwv_flow_custom_auth_std.login(
P_UNAME => l_username,
P_PASSWORD => l_password,
P_SESSION_ID => APEX_CUSTOM_AUTH.GET_SESSION_ID,
P_FLOW_PAGE => :APP_ID||':14'
);
--:CHECK_LOGIN_PW_EXIST := 1;
else
null;
end if;
exception when others then null;
end;
-----------------------------
I save the user name and password when user login.
-----------------------------
--Set Username Cookie
begin
owa_util.mime_header('text/html', FALSE);
owa_cookie.send(
name=>'LOGIN_USERNAME_COOKIE',
value=>lower(:P101_USERNAME),
expires=> sysdate + 10000,
path => '/',
secure => '');
exception when others then null;
end;
-----------------------------
--Set_Password_Cookie
begin
owa_util.mime_header('text/html', FALSE);
owa_cookie.send(
name=>'LOGIN_PASSWORD_COOKIE',
value=>:P101_PASSWORD,
expires=> sysdate + 10000,
path => '/',
secure => '');
exception when others then null;
end;
The issue is :
1. I can auto login normal when I open the window in the same window and different Tabs, But it will link to login page when I open a new window and input the URL.
>> Apex Cookie is the session level ?? Looks like I open a new window the cookie will be invalid.
2. I can't Logout in the same page if i click the logout. This issue I know the reason. But I don't find a good way to fix it.
>> anybody has a good way to fix that?
Thanks in advance.
PPMonkey
Edited by: PPMonkey on Jul 28, 2009 12:50 AM