Why isn't my session timing out??

Hello, Below is code of my session in the Page_Load method. I have set the session timeout = "1" in the web.Config folder, but it doesn't time out after a minute (I just used a minute for testing purposes cause it's quick)...anyway, can anyone help me?

  

1    public partial class ProdView : System.Web.UI.Page
2    {
3    
4        DataView dvProducts;
5        string _constring = WebConfigurationManager.ConnectionStrings["DBconnection"].ConnectionString;
6        void Page_Prerender()
7        {
8            GridView1.DataSource = dvProducts;
9            GridView1.DataBind();
10       }
11   
12       protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
13       {
14           dvProducts.Sort = e.SortExpression;
15           
16       }
17       protected void Page_Load(object sender, EventArgs e)
18       {
19   
20           dvProducts = (DataView)Session["ProdCount"];
21   
22               if (dvProducts == null)
23               {
24   
25                   GridView1.AllowPaging = true;
26   
27                   SqlDataAdapter dadapt = new SqlDataAdapter("SELECT * FROM PROD", _constring);
28                   DataTable dt = new DataTable();
29                   dadapt.Fill(dt);
30                   dvProducts = new DataView(dt);
31                   Session["session"] = dvProducts;
32   
33               }
 
0
dekij
5/4/2009 12:43:26 AM
asp.net.state-management 8807 articles. 0 followers. Follow

5 Replies
769 Views

Similar Articles

[PageSpeed] 3

This might help:

http://weblogs.asp.net/ashicmahtab/archive/2008/09/29/setting-timeouts-for-session-and-authentication.aspx


All that glitters is gold-
Only shooting stars break the mold.
0
HeartattacK
5/4/2009 2:58:23 AM

 what did you type in your webconfig to set 1 minute session timeout?


learning.. : )
0
aammiz
5/4/2009 3:16:48 AM

 This is what you type in but I don't know why it's not working.

   

<sessionState timeout="1"></sessionState>
 
0
dekij
5/4/2009 3:23:03 AM

dekij:
<sessionState timeout="1"></sessionState>

Session should timeout after 1 min of inactivity . And also change IIS session timeout value accordingly.



My Blog


"Don't be afraid to be wrong; otherwise you'll never be right."
0
budugu
5/4/2009 2:11:17 PM

 Duuuuh I had two different names for the session. I had "ProdCount" when I declared it and "session" when I assigned values to it. Everything works now that I made them the same name

0
dekij
5/4/2009 2:20:23 PM
Reply:

Similar Artilces:

Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'
 Hi,We are trying to implement Network loading for our asp.net (1.1) application for which we are storing the session in State Server.Following is the error is thrown while page is rendered when ever is a DTO is stored in to SEssion in any of the page.Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer' Following the code I written for DTO (C# Asp.net 1.1).     using System;    using System.Runtime.Serializa...

'Password Management' isn't shown in iManager
Hi All I need to set up a DirXML, or rather Identity Manager 2 here. I've had to reinstall the iManager here, as it wen't haywire after a consultant had messed about on the server. For some reason RBS is activated (is there a way to remove that?) I followed the Universal Password Deployment Guide., the SDI works nicely as far as I can gather from it. I've looked in the TID10091354 to set up universal password further. But I don't see a 'Password Management' task in the left window. I see: Dynamic Groups, eDirectory Adminstration, eDirectory Maintenance, G...

Why Windows Isn't Hell Or Why Linux Isn't Bliss
I tend to think the latter. Not because I am not a Linux fan (I happily set up my Computer with Mandrake about two years ago, they are still merrily in love), but because I have not heard anything new in the past two years. It is always "my god, not another security hole in Windows 95/98/98SE/ME/2000/XP/Server 2003", "Microsoft aggressively bought company X", "Microsoft launches another way to protect their software" and "Microsoft software is too exspensive". And Linux, on the other hand, is all bliss. Well, I think Linux is not all "bliss"...

Firefox RC3 Can't log in to www.tradedoubler.com. Error: 'Session timed out'
Name: jt Email: infoatkuvauskomeettadotfi Product: Firefox Release Candidate Summary: Firefox RC3 Can't log in to www.tradedoubler.com. Error: 'Session timed out' Comments: Firefox RC3 Can't log in to www.tradedoubler.com. Error: 'Session timed out' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

_stop state isn't called on child when parent gets Ctrl-C (EasyDBI session still active)
--00163692050156259e046970194a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello once again POE world, *I have a problem with a child daemon process not being killed when I hit Ctrl-C for the parent. All other children are reaped but one remains. This child happens to be the one using EasyDBI. *I have noticed that when I hit Ctrl-C......I don't see the _stop event called for any of the spawned children. This _stop event is what calls $kernel->post( 'EasyDBI', 'shutdown' => 'NOW' ); *I'm assuming that the re...

superreview granted: [Bug 283345] Description of Profile Manager's <dialogheader> isn't updated when switching from Select Profile to Manage Profile mode : [Attachment 175337] Patch
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has granted Stefan Borggraefe <Stefan.Borggraefe@gmx.de>'s request for superreview: Bug 283345: Description of Profile Manager's <dialogheader> isn't updated when switching from Select Profile to Manage Profile mode https://bugzilla.mozilla.org/show_bug.cgi?id=283345 Attachment 175337: Patch https://bugzilla.mozilla.org/attachment.cgi?id=175337&action=edit ...

superreview requested: [Bug 283345] Description of Profile Manager's <dialogheader> isn't updated when switching from Select Profile to Manage Profile mode : [Attachment 175337] Patch
Stefan Borggraefe <Stefan.Borggraefe@gmx.de> has asked neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> for superreview: Bug 283345: Description of Profile Manager's <dialogheader> isn't updated when switching from Select Profile to Manage Profile mode https://bugzilla.mozilla.org/show_bug.cgi?id=283345 Attachment 175337: Patch https://bugzilla.mozilla.org/attachment.cgi?id=175337&action=edit ------- Additional Comments from Stefan Borggraefe <Stefan.Borggraefe@gmx.de> The code used the wrong attribute to update this UI string. ...

Why can't I check when a session is timing out without refreshing the session?!?!!
I need to have a way of querying the server and getting the user's time left before the session expires.  That's it.  I put this code into the OnTick event of my Ajax Timer control and do stuff based on the value of the time left.  But it seems to be impossible to do without actually refreshing the session on the server.  I've been working on this for 3 DAYS now, and I have to admit, I'm ready to jump out the window.  Everything I try fails at some point...  It shouldn't be this hard!!! So I first tried the method outlined in many ...

cpan>install NET::SSH ----> Can't install NET::SSH don't know what it is?
Good day! This is the first time I'll be using the cpan to install modules. I run: perl -MCPAN -e shell and answer the questions one by one. When its done, I issued install NET::SSH at the cpan> prompt and I got the message: Can't install NET::SSH Don't know what it is. Question: How will I make cpan> know what NET::SSH is? Is there something I have to update first? How can I search for some useful modules using cpan> rather than using cpan search in www.cpan.org? What is auto bundle? And what does 'cpan -a' does? When I ran it, I can some...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226289] pass state in the channel
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226289: pass state in the channel https://bugzilla.mozilla.org/attachment.cgi?id=226289&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is another idea I had - we can pass state on the channel which indicates whether a new ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225651] check that session history is
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225651: check that session history is empty https://bugzilla.mozilla.org/attachment.cgi?id=225651&action=edit ...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226289] pass state in the channel
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226289: pass state in the channel https://bugzilla.mozilla.org/attachment.cgi?id=226289&action=edit ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226606] store state in channel, works
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226606: store state in channel, works for target= as well as window.open https://bugzilla.mozilla.org/attachment.cgi?id=226606&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is a second iteration on the patch that stores s...

superreview denied: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225651] check that session history is em
Darin Fisher (Google) <darin@meer.net> has denied Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225651: check that session history is empty https://bugzilla.mozilla.org/attachment.cgi?id=225651&action=edit ------- Additional Comments from Darin Fisher (Google) <darin@meer.net> Marria and I discussed this today. She's got a much bett...

Just because it's Signed doesn't mean it isn't spying on you
"While it has been rather peaceful on the mobile malware front, mobile spyware and spying tools have been active lately. This week, we have received samples of two new mobile spying tools � running on new platforms. There is now spyware for both Windows Mobile and Symbian S60 3rd Edition devices."... <http://www.f-secure.com/weblog/archives/archive-052007.html#00001190> or http://preview.tinyurl.com/2zryvd -- js ...

superreview granted: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 226606] store state in channel, works f
Darin Fisher (Google) <darin@meer.net> has granted Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 226606: store state in channel, works for target= as well as window.open https://bugzilla.mozilla.org/attachment.cgi?id=226606&action=edit ------- Additional Comments from Darin Fisher (Google) <darin@meer.net> >Index: docshell/base/nsDoc...

[BUG]: __doPostback isn't added during a partial postback; this may lead to errors if the method isn't added to the page during initial rendering
The problem can be reproduced as follows: 1) Create a project. Use the Web Projects Overlay: http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx 2) Add a User Defined control (Master) 3) Add two nested User Defined Controls (NCtrl1, NCtrl2). NCtrl1 defaults to visible=true, NCtrl2 defaults to visible=false. Add some text to NCtrl2. 4) In the master control, add a public method to make visible/invisible the nested controls (NCtrl1, NCtrl2). Call it CtrlMeth1. 5) To NCtrl1 Add a GridView nested within an UpdatePanel Atlas mechanism. 6) In the GridView e...

Isn't working... I don't understand?
I'm trying to put together a very simple page where you can click the up and down button to move the item up or down in the list and save the new list into the database. I've run the stored procedure... and it works so Its not a procedure problem. Here is the list in my databaseOrder_Id        Item         Position1                  Sebring     12                  GrandPri...

Don't fix what isn't broken!
Name: Keith Cronin Email: k_croninatbellsouthdotnet Product: Firefox Summary: Don't fix what isn't broken! Comments: You've completely messed up my bookmarks with this latest upgrade. Why do that? Why not leave them alone instead of resorting them. You're worse than Microsoft, always fixing things that aren't broken. You've made it HARDER to surf the web, not easier. Opera, here I come. Or maybe Chrome. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 From URL: http://hendrix.mozilla.org...

After a looong night managed to change Session mode from inProc to SQLServer but still can't get the session variables to be saved
Hi,  I ran my Shopping Cart project and somehow everything worked fine(while in inProc), session variables were saved fine. I made some changes to my project and since then keep getting null session variables, no matter what I do. It took me the whole night to figure out how to turn to SQLServer mode,  marked custom classes as 'Serializable' with [Serializable] before the class definition but everything's in vain. Getting the same damned 'nulls' instead of the saved objects. private void Page_Load(object sender, System.EventArgs e)         {...

Messages don't always get sent if computer's date isn't right
I've found that if my computer's date is off by more than some unknown amount, when I send a message it doesn't always really get sent. Yet I don't get an error indication, and the message appears in my Sent folder right along with the rest of my sent messages. Anyone know how much my computer's date can differ from true time before this problem appears? Some of my messages to newsgroups had their dates off by two years, but still got posted. A few minutes ago, I sent two eamils to myself, one with my computer set to September 28, 2009 (one month error)...

Shouldn't a "sub" panel be hidden if it's in a panel that isn't visible?
I have two panels on a page.  Panel A, and then within Panel A is Panel B.  If Panel A's visibility is False, shouldn't Panel B's visibility automatically be false because it's within Panel A?  Never make important decisions on a Monday! If you mean its property, then no it will be whatever you set it to.If you mean whether or not it is rendered to html, then if it's parent isn't rendered, then it isn't rendered.You can set the visibilty of nested panels independently of their parents, what if you have two nested and you want to hide one and not t...

superreview granted: [Bug 257877] replacement content isn't rendered if gkplugin.dll isn't present : [Attachment 157776] handle replacement content w/o gkplugin -uwp
Boris Zbarsky (no tree till Sept 10) <bzbarsky@mit.edu> has granted timeless@myrealbox.com (working) <timeless@bemail.org>'s request for superreview: Bug 257877: replacement content isn't rendered if gkplugin.dll isn't present http://bugzilla.mozilla.org/show_bug.cgi?id=257877 Attachment 157776: handle replacement content w/o gkplugin -uwp http://bugzilla.mozilla.org/attachment.cgi?id=157776&action=edit ------- Additional Comments from Boris Zbarsky (no tree till Sept 10) <bzbarsky@mit.edu> sr=bzbarsky ...

superreview requested: [Bug 257877] replacement content isn't rendered if gkplugin.dll isn't present : [Attachment 157776] handle replacement content w/o gkplugin -uwp
timeless@myrealbox.com (working) <timeless@bemail.org> has asked Boris Zbarsky (no tree till Sept 10) <bzbarsky@mit.edu> for superreview: Bug 257877: replacement content isn't rendered if gkplugin.dll isn't present http://bugzilla.mozilla.org/show_bug.cgi?id=257877 Attachment 157776: handle replacement content w/o gkplugin -uwp http://bugzilla.mozilla.org/attachment.cgi?id=157776&action=edit ...

Web resources about - Why isn't my session timing out?? - asp.net.state-management

Resources last updated: 2/17/2016 7:37:19 PM