Saturday, March 31, 2012

Session Timeout using frames

Hello,

My main ASP.NET interface uses frames. The problem is that once the session
times out (if the user hasn't yet closed the browser), the user is
automatically redirected to the login screen (setup in Web.Config file), but
this occurs for every frame!!! Is there a way to redirect away from the main
interface completely?

Thanks!your frame page is html or aspx?
if it is html try to rename in aspx!

"Bilbo" <Bilbo@.cox.net> wrote in message
news:OSWo03XVEHA.1652@.TK2MSFTNGP09.phx.gbl...
> Hello,
> My main ASP.NET interface uses frames. The problem is that once the
session
> times out (if the user hasn't yet closed the browser), the user is
> automatically redirected to the login screen (setup in Web.Config file),
but
> this occurs for every frame!!! Is there a way to redirect away from the
main
> interface completely?
> Thanks!
Its kinda irritating but I found a solution for it.
Use this javascript so the login page will "bust out of frame".

<script>
if (parent.frames.length > 0) {
parent.location.href = self.document.location
}
</script
This script make sure that the page will bust out of frame, so you only have
one login page.

Richard

"Bilbo" <Bilbo@.cox.net> schreef in bericht
news:OSWo03XVEHA.1652@.TK2MSFTNGP09.phx.gbl...
> Hello,
> My main ASP.NET interface uses frames. The problem is that once the
session
> times out (if the user hasn't yet closed the browser), the user is
> automatically redirected to the login screen (setup in Web.Config file),
but
> this occurs for every frame!!! Is there a way to redirect away from the
main
> interface completely?
> Thanks!
In the Login Page add this Client Side Code so that you can "Break Away
From Frames"

<Script Language="JavaScript">
if (top != self) {top.location.href = self.location.href;}
</Script --
Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Session Timeout setting in IIS.

IIS has a Session Timeout setting. How does this setting coincide with the
ASP.NET property Session.SessionTimeout value. If I change this value in
code, will it override the IIS Session Timeout setting?
--
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
--Hi,
IIS's session settings affect only classic ASP etc, not ASP.NET's and vice
versa (with ASP.NET/Framework 2.0 you get ASP.NET tab on IIS where you can
manage config file settings, those do have affect on ASP.NET but of course
not on classic ASP)
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Ken Varn" <nospam> wrote in message
news:eOGLehIkGHA.1296@.TK2MSFTNGP05.phx.gbl...
> IIS has a Session Timeout setting. How does this setting coincide with
> the
> ASP.NET property Session.SessionTimeout value. If I change this value in
> code, will it override the IIS Session Timeout setting?
> --
> --
> Ken Varn
> Senior Software Engineer
> Diebold Inc.
> EmailID = varnk
> Domain = Diebold.com
> --
>

Session Timeout setting in IIS.

IIS has a Session Timeout setting. How does this setting coincide with the
ASP.NET property Session.SessionTimeout value. If I change this value in
code, will it override the IIS Session Timeout setting?

--
-----------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------Hi,

IIS's session settings affect only classic ASP etc, not ASP.NET's and vice
versa (with ASP.NET/Framework 2.0 you get ASP.NET tab on IIS where you can
manage config file settings, those do have affect on ASP.NET but of course
not on classic ASP)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Ken Varn" <nospam> wrote in message
news:eOGLehIkGHA.1296@.TK2MSFTNGP05.phx.gbl...
> IIS has a Session Timeout setting. How does this setting coincide with
> the
> ASP.NET property Session.SessionTimeout value. If I change this value in
> code, will it override the IIS Session Timeout setting?
> --
> -----------
> Ken Varn
> Senior Software Engineer
> Diebold Inc.
> EmailID = varnk
> Domain = Diebold.com
> -----------

Session time-out,when the page breaks?

Hi..

I had published a website in the server( I am using VS 2005,ASP.NET2.0, With C#) . I tried testing the site by asking several users to login to the website and do unit testing. At one instance of time, the page breaks for a particular user. When the page breaks, the other users who are tesing in their machine are getting a session time-out and are forced to log out.

Why is such a session-time out issue happening, when one of the users page breaks. I have set the session variable to 20 minutes,which is the default. But what's confusing is , when one of the user's page breaks, the others get a session time-out? Why is such a session-time out occuring?

Please help.

Thanks.

What do you mean when you say "the page breaks?" If an app pool cycles you might see this effect. Have you diagnosed the "page break" to see what happens?

Jeff


Thank you very much for the reply.

The page break, I referred is the page crashing(asp.net error page) .I have customized the error page to show, An Unexpected error occurred, please try after some time.

But when the user tries the same steps to find the page crash, he is not able to, as the page works well. This is a kind of absurd. The page is not crashing always, but it is random. I checked the log, but it was not providing much information. I also could not re-trace the page crash, as the page worked well.

But why is the session getting timed out for the other users, when one of the users page crashes?

Thanks.


Hi..

I am sorry that I forgot to include a scenario in my web page,which i am doing. I have written a code to delete a folder in the session end in global.asax. When i commented the code, and tried testing, the session time out was not occuring.

I searched in the google, and came out with this:

http://www.velocityreviews.com/forums/t116975-all-session-are-getting-down-when-i-delete-sessions-folders.html

Is this the reason for all sessions getting timed-out, when a page crashes?

Thanks


Hi Venkatzeus,

As far as i know, if you delete a folder which is in your application directory, the appDomain will restart, and you will lose your session.

I hope this helps.


This happens as your worker process memory limits get full and asp.net worker process gets restarted. how to do this setting you can find at

http://www.asp.net/faq/AspNetAndIIS6.aspx

But I think you needs to findout why its getting full.

When you get this error check server CPU Usage what it shows?

then debug.


HI,,

Thank you very much for the reply. I will try with it and provide the results.

Thanks

Session Timeout, not working

I have set the session timeout something greater then 20 minutes in
the web.config(120 minutes for testing) after 20 minutes to 30 minutes
click a button and am redirected back to the login. My Session is
reporting 120 minutes I know this becuase I display on a debug page.
below are the 2 areas in the web.config that I set anybody tell me
whats wrong or what is missing.
<sessionState mode="InProc" regenerateExpiredSessionId="false"
timeout="120">
</sessionState>
<forms name=".GSNAUTH" loginUrl="Login.aspx" path="/"
protection="Encryption" timeout="120" slidingExpiration="true"/>
When previeing on the page I see the top 1 becuase I have been able
to adjust it down to 60 minutes or 35 minutes whatever.
When I display on the debug page I show
lblSessionTimeout.text = Session.Timeout;
NOt sure what I am missing."Scott" <sremiger@.groceryshopping.net> wrote in message
news:47b0bb72-a003-4f59-9e19-fb5cbe61e720@.o77g2000hsf.googlegroups.com...
> I have set the session timeout something greater then 20 minutes in
> the web.config(120 minutes for testing) after 20 minutes to 30 minutes
> click a button and am redirected back to the login. My Session is
> reporting 120 minutes I know this becuase I display on a debug page.
> below are the 2 areas in the web.config that I set anybody tell me
> whats wrong or what is missing.
> <sessionState mode="InProc" regenerateExpiredSessionId="false"
> timeout="120">
> </sessionState>
> <forms name=".GSNAUTH" loginUrl="Login.aspx" path="/"
> protection="Encryption" timeout="120" slidingExpiration="true"/>
> When previeing on the page I see the top 1 becuase I have been able
> to adjust it down to 60 minutes or 35 minutes whatever.
> When I display on the debug page I show
> lblSessionTimeout.text = Session.Timeout;
> NOt sure what I am missing.
Unless you have other clients creating activity on the site your Application
Pool is probably timing out. When a pool has seen absolutely no activity
whatsoever it can shutdown. Check the settings on the pool to which your
application belongs.
Anthony Jones - MVP ASP/ASP.NET
Session expiration and forms authentication timeouts are two separate and
distinct things. Being redirected to a login page is a forms authentication
timeout issue, unless somehow you are also using session to do this.
Your ASP.NET application can recycle for any number of reasons, and when it
does, all inProc Sessions go bye-bye.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: htp://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Scott" wrote:

> I have set the session timeout something greater then 20 minutes in
> the web.config(120 minutes for testing) after 20 minutes to 30 minutes
> click a button and am redirected back to the login. My Session is
> reporting 120 minutes I know this becuase I display on a debug page.
> below are the 2 areas in the web.config that I set anybody tell me
> whats wrong or what is missing.
> <sessionState mode="InProc" regenerateExpiredSessionId="false"
> timeout="120">
> </sessionState>
> <forms name=".GSNAUTH" loginUrl="Login.aspx" path="/"
> protection="Encryption" timeout="120" slidingExpiration="true"/>
> When previeing on the page I see the top 1 becuase I have been able
> to adjust it down to 60 minutes or 35 minutes whatever.
> When I display on the debug page I show
> lblSessionTimeout.text = Session.Timeout;
> NOt sure what I am missing.
>

Session Timeout using frames

Hello,
My main ASP.NET interface uses frames. The problem is that once the session
times out (if the user hasn't yet closed the browser), the user is
automatically redirected to the login screen (setup in Web.Config file), but
this occurs for every frame!!! Is there a way to redirect away from the main
interface completely?
Thanks!your frame page is html or aspx?
if it is html try to rename in aspx!
"Bilbo" <Bilbo@.cox.net> wrote in message
news:OSWo03XVEHA.1652@.TK2MSFTNGP09.phx.gbl...
> Hello,
> My main ASP.NET interface uses frames. The problem is that once the
session
> times out (if the user hasn't yet closed the browser), the user is
> automatically redirected to the login screen (setup in Web.Config file),
but
> this occurs for every frame!!! Is there a way to redirect away from the
main
> interface completely?
> Thanks!
>
In the Login Page add this Client Side Code so that you can "Break Away
From Frames"
<Script Language="JavaScript">
if (top != self) {top.location.href = self.location.href;}
</Script -->
Trevor Benedict R
MCSD
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Its kinda irritating but I found a solution for it.
Use this javascript so the login page will "bust out of frame".
<script>
if (parent.frames.length > 0) {
parent.location.href = self.document.location
}
</script>
This script make sure that the page will bust out of frame, so you only have
one login page.
Richard
"Bilbo" <Bilbo@.cox.net> schreef in bericht
news:OSWo03XVEHA.1652@.TK2MSFTNGP09.phx.gbl...
> Hello,
> My main ASP.NET interface uses frames. The problem is that once the
session
> times out (if the user hasn't yet closed the browser), the user is
> automatically redirected to the login screen (setup in Web.Config file),
but
> this occurs for every frame!!! Is there a way to redirect away from the
main
> interface completely?
> Thanks!
>

Session Timeout..

When the session times out, I would like to navigate to the login page.
Currently when the session times out, the displayed screen remains visible
on the screen however when the user clicks on the screen will take to the
login page.

How to do that?

BenjaminYou could try using the javascript setTimeout function set to 20 minutes
(the default session timeout period) and then set the
document.location.href='login.aspx' via client side code.
Here's an example of using the javascript setTimeout function:
http://www.crowes.f9.co.uk/Javascript/timer.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> When the session times out, I would like to navigate to the login page.
> Currently when the session times out, the displayed screen remains visible
> on the screen however when the user clicks on the screen will take to the
> login page.
> How to do that?
> Benjamin
Hi i had the same problem.
Buti fixed..
If u need a more detailed script let me know!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Yes, I need to know.
Benjamin

"naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> Hi i had the same problem.
> Buti fixed..
> If u need a more detailed script let me know!
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
But what do you really want to do?

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:eFTtrasmEHA.2908@.TK2MSFTNGP12.phx.gbl...
> Yes, I need to know.
> Benjamin
> "naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
> news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi i had the same problem.
> > Buti fixed..
> > If u need a more detailed script let me know!
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
Steve gave you the answer. In more detail:

Session times out (by default) 20 minutes after the last Request was
received by the client browser instance holding that SessionID in a
temporary cookie. As no request is received on the server, no response can
be sent to the client. Therefore, the redirect MUST occur on the client.
That means JavaScript. And that means that your JavaScript function should
fire just as the Session times out (20 minutes). You would use the
JavaScript setTimeOut() function to accomplish this.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
news:eFTtrasmEHA.2908@.TK2MSFTNGP12.phx.gbl...
> Yes, I need to know.
> Benjamin
> "naijacoder naijacoder" <naijacoder@.toughguy.net> wrote in message
> news:eu0aGPsmEHA.3988@.tk2msftngp13.phx.gbl...
> > Hi i had the same problem.
> > Buti fixed..
> > If u need a more detailed script let me know!
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
Thanks for your answers.

Now I understand I have to use setTimeout to achieve my goal.

The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really helpful.

Which client side event I should use to keep track the user is still using
the website.

Thanks,

Benjamin

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
> You could try using the javascript setTimeout function set to 20 minutes
> (the default session timeout period) and then set the
> document.location.href='login.aspx' via client side code.
> Here's an example of using the javascript setTimeout function:
> http://www.crowes.f9.co.uk/Javascript/timer.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> > When the session times out, I would like to navigate to the login page.
> > Currently when the session times out, the displayed screen remains
visible
> > on the screen however when the user clicks on the screen will take to
the
> > login page.
> > How to do that?
> > Benjamin
Also I would like to inform the user just before X seconds of page expiry. I
do not want to use alert(). Is it possible to display the message on the
tool bar as once the count down for expire starts.

Thanks,

Benjamin

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
> You could try using the javascript setTimeout function set to 20 minutes
> (the default session timeout period) and then set the
> document.location.href='login.aspx' via client side code.
> Here's an example of using the javascript setTimeout function:
> http://www.crowes.f9.co.uk/Javascript/timer.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
> > When the session times out, I would like to navigate to the login page.
> > Currently when the session times out, the displayed screen remains
visible
> > on the screen however when the user clicks on the screen will take to
the
> > login page.
> > How to do that?
> > Benjamin
The browser will keep track of that for you.
All you need is one client side event to fire once the trigger time has
elapsed and you want to warn the user.
You can name the event anything you want.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin" <BenSmithNg@.hotmail.com> wrote in message
news:uan1PfQnEHA.392@.tk2msftngp13.phx.gbl...
> Thanks for your answers.
> Now I understand I have to use setTimeout to achieve my goal.
> The link http://www.crowes.f9.co.uk/Javascript/timer.htm is really
> helpful.
> Which client side event I should use to keep track the user is still using
> the website.
> Thanks,
> Benjamin
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
>> You could try using the javascript setTimeout function set to 20 minutes
>> (the default session timeout period) and then set the
>> document.location.href='login.aspx' via client side code.
>> Here's an example of using the javascript setTimeout function:
>> http://www.crowes.f9.co.uk/Javascript/timer.htm
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
>> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
>> > When the session times out, I would like to navigate to the login page.
>> > Currently when the session times out, the displayed screen remains
> visible
>> > on the screen however when the user clicks on the screen will take to
> the
>> > login page.
>>> > How to do that?
>>> > Benjamin
>>>>
>>
Yes you can display a message to the status bar of the browser.
Here's a nice example:
http://simplythebest.net/scripts/DH...ascript_58.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Benjamin" <BenSmithNg@.hotmail.com> wrote in message
news:uGdHQhQnEHA.3520@.TK2MSFTNGP11.phx.gbl...
> Also I would like to inform the user just before X seconds of page expiry.
> I
> do not want to use alert(). Is it possible to display the message on the
> tool bar as once the count down for expire starts.
> Thanks,
> Benjamin
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:#lv4LermEHA.324@.TK2MSFTNGP11.phx.gbl...
>> You could try using the javascript setTimeout function set to 20 minutes
>> (the default session timeout period) and then set the
>> document.location.href='login.aspx' via client side code.
>> Here's an example of using the javascript setTimeout function:
>> http://www.crowes.f9.co.uk/Javascript/timer.htm
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://Steve.Orr.net
>>
>>
>> "Benjamin Smith" <BenSmithNg@.hotmail.com> wrote in message
>> news:%23%23YjkXrmEHA.3608@.TK2MSFTNGP09.phx.gbl...
>> > When the session times out, I would like to navigate to the login page.
>> > Currently when the session times out, the displayed screen remains
> visible
>> > on the screen however when the user clicks on the screen will take to
> the
>> > login page.
>>> > How to do that?
>>> > Benjamin
>>>>
>>