Asp page authentication
From: William E Hatto (xxnospamxxweh_at_bigpond.net.au)
Date: 03/24/04
- Next message: Bob Barrows [MVP]: "Re: INSERT from ASP to Access crashes"
- Previous message: Bob Barrows [MVP]: "Re: INSERT from ASP to Access crashes"
- Next in thread: Tom Kaminski [MVP]: "Re: Asp page authentication"
- Reply: Tom Kaminski [MVP]: "Re: Asp page authentication"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 22:32:42 +0800
My thanks to Nathan for the code below, but it does not work. I get the
following error;
Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dev/development/WAN RCI Secure/DumpSearch.asp, line 700
Function AuthCheckT
How can I get this to work?
Cheers, Bill.
Use some Javascript code to check the window.opener value. If it is
null, the window was navigated directly to. If it is not null, it will
contain a reference to the window that opened it - you code would look
something like:
<script language=javascript>
function doLogin() {
if (window.opener == null) {
document.location.href = "default.asp?status=timeout";
}
else {
window.opener.document.location.href =
"default.asp?status=timeout";
window.close();
}
}
<%
Function AuthCheck()
If IsEmpty(Session("UID")) then
Response.Write "doLogin();"
End If
End Function
%>
</script>
The ASP code MUST be inside the script block - the JScript function
will always be on the page, but only when the ASP checks the session
and finds nothing there is the call to the function written up to the
browser. I didn't actually test the Javascript, so it might not be
100% accurate, but you should be able to get the idea.
"William E Hatto" <xxnospamxxweh@bigpond.net.au> wrote in message
news:<e9SQ4MoDEHA.548@TK2MSFTNGP10.phx.gbl>...
> Hi 1 and all,
>
> I have an asp application/web site that uses a logon page then a page for
> the menus and separate asp pages for all the options in the menus.
>
> The options listed in the menu's spawn separate web windows leaving the
menu
> page in the background.
>
> Common to all of these pages I am using authentication. The authentication
> function is as follows;
>
> Function AuthCheck()
> If IsEmpty(Session("UID")) then
> Response.Redirect "default.asp?status=timeout"
> Response.End
> End If
> End Function
>
> My problem is when authentication is called on a spawned page it takes the
> spawned page back to logon. What I want to happen is the spawned page to
> close and the menu page return to the logon page.
>
> In the event a page is called without logging on and using the menus I
would
> like the page to revert back to the logon page.
>
> I understand it may require some 'fancy' javascript. I am using some
> javascript in my pages, but having only dabelled in it I am unable to use
it
> to the degree it may be required above.
>
> Can this be done, if so how?
>
>
> Many thanks, Bill.
- Next message: Bob Barrows [MVP]: "Re: INSERT from ASP to Access crashes"
- Previous message: Bob Barrows [MVP]: "Re: INSERT from ASP to Access crashes"
- Next in thread: Tom Kaminski [MVP]: "Re: Asp page authentication"
- Reply: Tom Kaminski [MVP]: "Re: Asp page authentication"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|