473,549 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What to do with Authentication/Session Timeout?

Hi,

I've a login page in which after authenticating it via the Oracle DB, I will
stored the user information into the Session. However, when the Session
timeout occurs, all of the user information will be lost.

I've tried doing a Reponse.Redirec t call back to my login page whenever I
detected the Session is null, but I kept getting the exception saying "...
Redirect not all in Page Callback".

Could anyone give me some pointer how I should approach this issue.

Thanks,
Simon
Nov 18 '06 #1
20 3754
"Simon Says" <si******@gmail .comwrote in message
news:eq******** ******@TK2MSFTN GP04.phx.gbl...
I've a login page in which after authenticating it via the Oracle DB, I
will stored the user information into the Session. However, when the
Session timeout occurs, all of the user information will be lost.

I've tried doing a Reponse.Redirec t call back to my login page whenever I
detected the Session is null, but I kept getting the exception saying "...
Redirect not all in Page Callback".

Could anyone give me some pointer how I should approach this issue.
Have you tried Server.Transfer instead of Response.Redire ct...?
Nov 18 '06 #2
Yes. Tried that and am still getting the same error message.

I've alot of client side javascripting in my code. I placed my Redirect call
in the Page_Load event in the .vb code. When the javascript code triggered
the Redirect, I'll have the error. But, when I execute a server control
event, like a clicking a button that do a postback, my Redirect works fine.

--Simon
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:eg******** ******@TK2MSFTN GP02.phx.gbl...
"Simon Says" <si******@gmail .comwrote in message
news:eq******** ******@TK2MSFTN GP04.phx.gbl...
>I've a login page in which after authenticating it via the Oracle DB, I
will stored the user information into the Session. However, when the
Session timeout occurs, all of the user information will be lost.

I've tried doing a Reponse.Redirec t call back to my login page whenever I
detected the Session is null, but I kept getting the exception saying
"... Redirect not all in Page Callback".

Could anyone give me some pointer how I should approach this issue.

Have you tried Server.Transfer instead of Response.Redire ct...?

Nov 18 '06 #3
"Simon Says" <si******@gmail .comwrote in message
news:eS******** ******@TK2MSFTN GP04.phx.gbl...
I've alot of client side javascripting in my code.
OK.
I placed my Redirect call in the Page_Load event in the .vb code.
Ah - that might explain it...Does your page have other Page events (e.g.
Page_Init, Page_Prerender, Page_Unload etc)...

I've encountered similar issues with Response.Redire ct - e.g. if you place
Response.Redire ct in your Page_Init method, the Page_Load method will still
fire, but if you use Server.Transfer , the transfer will happen
immediately...
When the javascript code triggered the Redirect, I'll have the error.
??? What do you mean exactly - how is your client-side JavaScript making a
call to Response.Redire ct...?

Generally speaking, I do all of this stuff in a base class which all pages
inherit, or which the MasterPage(s) inherit(s):

public class BaseMasterEvent s : Page
{
public BaseMasterEvent s()
{
this.PreInit += new EventHandler(Ba seMaster_PreIni t);
}

private void BaseMaster_PreI nit(object sender, EventArgs e)
{
if (Session.IsNewS ession)
{
Server.Transfer ("~/sessionTimedOut .htm", false);
}
}
}

Nov 18 '06 #4
Yes. My page does has Page_init, and Page_Load events.

I'm working with some controls with AJAX functionality. Basically the tree
node click, in AJAX, will invoke a grid event in the server side to query
from DB, and display out the results ... all without having the page to
refresh. But, the page events still follows as if it's a postback action.So
.... when I do a tree node click, it will
1. Page_init
2. Page_load
3. grid_Initialize DataSource (this query the DB)
4. Page_init
5. Page_load

I've placed my session checking in the Page_Init event, and tried both
Redirect and Server.Transfer ; and both giving me the same exception. I've
also tried your suggestion and do it in my master page PreInit event, and
I'm also getting the same exception.

I got desparate and tried ClientScript.Re gisterStartUpSc ript to do a
"window.locatio n.replace(login .aspx)" and it too doesn't do anything.

--Simon
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:Op******** ******@TK2MSFTN GP06.phx.gbl...
"Simon Says" <si******@gmail .comwrote in message
news:eS******** ******@TK2MSFTN GP04.phx.gbl...
>I've alot of client side javascripting in my code.

OK.
>I placed my Redirect call in the Page_Load event in the .vb code.

Ah - that might explain it...Does your page have other Page events (e.g.
Page_Init, Page_Prerender, Page_Unload etc)...

I've encountered similar issues with Response.Redire ct - e.g. if you place
Response.Redire ct in your Page_Init method, the Page_Load method will
still fire, but if you use Server.Transfer , the transfer will happen
immediately...
>When the javascript code triggered the Redirect, I'll have the error.

??? What do you mean exactly - how is your client-side JavaScript making a
call to Response.Redire ct...?

Generally speaking, I do all of this stuff in a base class which all pages
inherit, or which the MasterPage(s) inherit(s):

public class BaseMasterEvent s : Page
{
public BaseMasterEvent s()
{
this.PreInit += new EventHandler(Ba seMaster_PreIni t);
}

private void BaseMaster_PreI nit(object sender, EventArgs e)
{
if (Session.IsNewS ession)
{
Server.Transfer ("~/sessionTimedOut .htm", false);
}
}
}

Nov 18 '06 #5
Mat
why dont you increase the timeout in web.config?

"Simon Says" <si******@gmail .comwrote in message
news:eq******** ******@TK2MSFTN GP04.phx.gbl...
Hi,

I've a login page in which after authenticating it via the Oracle DB, I
will stored the user information into the Session. However, when the
Session timeout occurs, all of the user information will be lost.

I've tried doing a Reponse.Redirec t call back to my login page whenever I
detected the Session is null, but I kept getting the exception saying "...
Redirect not all in Page Callback".

Could anyone give me some pointer how I should approach this issue.

Thanks,
Simon

Nov 18 '06 #6
"Simon Says" <si******@gmail .comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Yes. My page does has Page_init, and Page_Load events.
Ah...
I'm working with some controls with AJAX functionality. Basically the tree
node click, in AJAX, will invoke a grid event in the server side to query
from DB, and display out the results ... all without having the page to
refresh. But, the page events still follows as if it's a postback
action.So ... when I do a tree node click, it will
1. Page_init
2. Page_load
3. grid_Initialize DataSource (this query the DB)
4. Page_init
5. Page_load
You appear to be loading the page twice - why do steps 4 and 5 occur?
I've placed my session checking in the Page_Init event, and tried both
Redirect and Server.Transfer ; and both giving me the same exception. I've
also tried your suggestion and do it in my master page PreInit event, and
I'm also getting the same exception.
Hmm - MasterPages don't have a PreInit event, so I'm assuming you're doing
the same Page inheritance stuff as I am...

I'm starting to run out of ideas now...
Nov 18 '06 #7
"Mat" <Ma*******@hotm ail.comwrote in message
news:xo******** ************@we ber.videotron.n et...
why dont you increase the timeout in web.config?
ROTFLMAO!!!

When you get a warning light in your car, do you just do the Homer Simpson
fix by putting a strip of tape over it...?
Nov 18 '06 #8
Well ... coz my boss disagree to it :-)

I'm using a longer timeout for a temp. fix now, but ... the site just feels
more professional if it can re-direct whenever the timeout occurs.

"Mat" <Ma*******@hotm ail.comwrote in message
news:xo******** ************@we ber.videotron.n et...
why dont you increase the timeout in web.config?

"Simon Says" <si******@gmail .comwrote in message
news:eq******** ******@TK2MSFTN GP04.phx.gbl...
>Hi,

I've a login page in which after authenticating it via the Oracle DB, I
will stored the user information into the Session. However, when the
Session timeout occurs, all of the user information will be lost.

I've tried doing a Reponse.Redirec t call back to my login page whenever I
detected the Session is null, but I kept getting the exception saying
"... Redirect not all in Page Callback".

Could anyone give me some pointer how I should approach this issue.

Thanks,
Simon


Nov 18 '06 #9
I think step 4 and 5 occurs coz the initializeDataS ource event. In step 3, I
got the dataset and stored it in the Cache, then in Step5, I assigned the
dataset from the Cache and blind it to my grid.

Ya ... I've the PreInit in the child page; not in the master page.

Man ... this web development thinggy is not as easy as I though. Thanks for
all your ideas though.
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:uR******** ******@TK2MSFTN GP04.phx.gbl...
"Simon Says" <si******@gmail .comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>Yes. My page does has Page_init, and Page_Load events.

Ah...
>I'm working with some controls with AJAX functionality. Basically the
tree node click, in AJAX, will invoke a grid event in the server side to
query from DB, and display out the results ... all without having the
page to refresh. But, the page events still follows as if it's a postback
action.So ... when I do a tree node click, it will
1. Page_init
2. Page_load
3. grid_Initialize DataSource (this query the DB)
4. Page_init
5. Page_load

You appear to be loading the page twice - why do steps 4 and 5 occur?
>I've placed my session checking in the Page_Init event, and tried both
Redirect and Server.Transfer ; and both giving me the same exception. I've
also tried your suggestion and do it in my master page PreInit event, and
I'm also getting the same exception.

Hmm - MasterPages don't have a PreInit event, so I'm assuming you're doing
the same Page inheritance stuff as I am...

I'm starting to run out of ideas now...

Nov 18 '06 #10

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

Similar topics

0
2842
by: Mark MacRae | last post by:
I am trying to do some testing of my application with respect to timeouts (i.e. Session timeouts). I took the advice of somebody else in this newsgroup (I think) and set my forms authentication timeout to be one minute less than the session timeout, but I was still getting wierd things happen when a timeout would occur. Today I set the...
4
5557
by: Jay | last post by:
I have authentication set for my site but I need one page to be an exception case. Namely my forgot password page. How do I tell the webconfig file to authenciate all pages except one page? Thank You for any input on this matter!
3
4845
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this...
2
1514
by: Dotnet Guy | last post by:
Hi, I have different asp.net applications as sub applications within an application and was using Framework 1.0. And I use forms authentication across the applications. In the web.config file of outer application I have <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="Default.aspx" path="/" timeout="20"/> </authentication> ...
1
1669
by: Andy Fish | last post by:
Hi, I have an asp.net web app whereby I authenticate the user with Forms Authentication and store details about him in the session. I want to be able to catch an event when the users authentication period expires but I can't see any way to do this. Currently I have set the forms authentication expiry shorter than the session expiry...
1
2619
by: Ben S | last post by:
we have a webapp using form authentication, and the time out is set at 120 minutes, so whenever a session is idle for > 120 minutes or so, it will make the user sign in again. This seems to be working okay on my developement machine (xp sp1) and on our staging machine (win server 2003). However, on our production machine (window 2000...
15
2114
by: Edwin Knoppert | last post by:
I have searched but info is limitted. In my test app i used a non persistant cookie for forms authentication. slidingExpiration is set to true On run and close and rerun the login remains ok. I have a time-out of one minute and indeed, it directs me to the login if i wait to long. The slidingExpiration does it's work also.
7
26311
by: Adrian Parker | last post by:
We have an application that's running ok on most of our customers machines, but on one of them we get an error. They're running on windows 2003 server with iis6. In the web.config, the authentication is set to forms, and the form tag contains: timeout="25" slidingExpiration="true" Event Type: Information Event Source: ASP.NET 2.0.50727.0...
1
5710
by: gnewsgroup | last post by:
I am using forms authentication for a web application. Like many other member web application, my web application prints out Welcome! John Doe (Logout) on the top right corner of each protected page. But, pages can still be visited by following the links in the web application after a session has timed out, data can still be retrieved
0
7521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7959
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7473
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.