473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Session Management when launching "New" Window

We have a web application that, for the purposes of reporting, launches a
new window to display the contents of the report in (PDF format). This is
implemented using a custom IHttpHandler implementation in our project.

The report is launched by a standard hyperlink with a target="blank" to
force the new window.

The one problem I have noticed is that if the user leaves the "launcher"
page open a long time, the web server will invariably time out, which leaves
the question of what the IHttpHandler should do.

Obviously it cannot simply redirect to a "login" page since this is a
"child" window.

Ideally what should happen is a separate window should not launch at all,
and the main launcher window would return to the login page.

I'm not sure how I would make that happen. Something after the session check
must then cause a window to popup with the content programmatically.

What is the best way to do this and am I going to run into problems with the
popup blockers of various programs?

Thanks

Kevin
Apr 6 '06 #1
2 1501
Are you using forms based authentiaction, or a custom session based one that
you've coded yourself? You could maybe have the code that checks the session
redirect to a different page rather than the login. You could then redirect
to a page with some javascript that checks if it's a child window and take
action accordingly, something like this:

<script language="javascript" type="text/javascript">
<!--
if (window.opener)
{
//window is a child window, close this window
window.close();
}
else
{
//not a child window, implement your logic for redirecting to
the login page here
}
//-->
</script>

The only thing is, I'm not sure if the window.opener is kept accross page
requests, you'd have to try it and see, but something like that might be
worth looking at?

Tim.
Apr 6 '06 #2
I'm not sure I fully understand the terminology of "forms based
authentication" or a custom one we've written ourselves. So to explain, our
user starts at a login page which accepts their credentials and then our
ASP.NET page [currently] creates a session object against our application
server, which is stored in session state (later this shall become more
light-weight and the application server sessions shall be created on the
fly).

Your suggestion is largely what I was thinking (I think) and part of my
question was querying whether the various browsers are going to complain
about window.close( ) being executed in javascript.

Thanks

Kevin

"Tim Payne" <ti*@attackmonkey.co.uk> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Are you using forms based authentiaction, or a custom session based one
that you've coded yourself? You could maybe have the code that checks the
session redirect to a different page rather than the login. You could then
redirect to a page with some javascript that checks if it's a child window
and take action accordingly, something like this:

<script language="javascript" type="text/javascript">
<!--
if (window.opener)
{
//window is a child window, close this window
window.close();
}
else
{
//not a child window, implement your logic for redirecting to
the login page here
}
//-->
</script>

The only thing is, I'm not sure if the window.opener is kept accross page
requests, you'd have to try it and see, but something like that might be
worth looking at?

Tim.

Apr 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
1
by: Robert Oschler | last post by:
Is there any way to "hook" the "open new window" event (if there is such an event) . I'd like to know if any element on the web page opens a new window through either: target="new"...
6
by: Tony G. | last post by:
Hi there, I have an APS 3 application, running on a Windows 2003 Web edition server - it is a very busy website, and when users are click on certain links (membership info), a new window i...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
1
by: spamproof2005 | last post by:
I have the following code: Dim BrowserLauncher As New ProcessStartInfo BrowserLauncher.FileName = URL BrowserLauncher.CreateNoWindow = False BrowserLauncher.UseShellExecute = True...
11
by: David Thielen | last post by:
Hi; In a page, when the user clicks on a button, I want to validate all the controls (in the code behind) and then if they are good, leave that page alone and launch a new window with a new url...
1
by: divya kr swami | last post by:
i have open a window javascript that should be close after 5 second. for this i have used following code. function GetMessage() { ...
1
by: =?Utf-8?B?YWxiZXJ0bHk=?= | last post by:
How can I create a new session from the existing session in asp.net when new IE session is opened using javascript's window.open method or user's hyperlink click? I have a web application which...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.