.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to set Session time out values

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net

I deployed ASP.Net 4.0  app on ISS, I wanted to set the session time out value to unlimited or any admisible maximum value. How to achieve that?

View Complete Post

More Related Resource Links

Session time out earlyer with in 5 min.


In my live site session time out with in 5 min only.how can i get the default i.e 20 min time . below webconfig file give below

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, &#xA;        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, &#xA;        PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, &#xA;        System.Web.Extensions, Ver

Session Time


Dear All,

My page is logging out in 20 minutes. I want my page should not be logged out for 60 mins.

Please suggest how to do this


How to store and retrieve multiple values in a single session variable .


I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.

how to check one time java script file download not every session

how to check one time java script file download not every session

pull values from session TList

I have populated a gridview with the following code string WhereClause = query; string OrderBY = "PostedOn desc"; int PageIndex = gvJobPosting.PageIndex; int PageSize = gvJobPosting.PageSize; int Count;   TList<JustClick.BLL.JobPosting> JobPosting; JobPosting = JustClick.DAL.DataRepository.JobPostingProvider.GetPaged(WhereClause, OrderBY, PageIndex, PageSize, out Count); Session["JobPosting"] = JobPosting; if (JobPosting.Count == 0) { errorMessage.Text = "There is no jobs available"; } else { gvJobPosting.DataSource = JobPosting; gvJobPosting.DataBind(); lblCurrentJob.Text = Count.ToString(); lblPostingsFound.Text = "job postings found."; btnExport.Visible = true; } and have a select button set to SelectedIndexChanged to pull all the details out and display in a formview i'm using the following code so far   protected void gvJobPosting_SelectedIndexChanged(Object sender, EventArgs e) { TList <JustClick.BLL.JobPosting> JobID; JobID = (TList<JustClick.BLL.JobPosting>)Session["JobPostings"]; int PostID = JobID[0].JobPostingID; TList<JustClick.BLL.JobPosting> JobPostID; JobPostID = JustClick.DAL.DataRepository.JobPostingProvider.GetByJobPostingID(PostID); }   But on int PostID = JobID[0].JobPostingID; i'm getting the error NullReferenceException Object reference not set to an i

How to Javascript download one time not every Session speed performance

my Side when open every time javascript file download i want only one time download not every time for web site speed performanceHow to Javascript download one time not every Session speed performance

Session time out alert box and redirect login page


Dear all,

Now I am using Form authentication for my website. 

It is something like that below. But if I left the website without using it for quite some time and when I used it back, it is redirected to the login page. 

The one I want to know is that it is because of session expire or cookies expire. And if it is session expired, I want to show the alert box and redirect to the login page. And one more thing is that if the user keeps on using the website, I want to extend the session expire time. If you do not mind, I want to have some references for this scenario. Thank you so much.


If myUser.IsValidUser(txtUserName.Text.Trim, txtPassword.Text.Trim) = True Then

ASP.NET session variables, do you need to save each time?


Anytime you change the object variable that is already assigned to a session variable, do you need to "re-save" the variable back into the session variable or does it do it automatically?

For example:

// abc is an object of some random type

Session["abc"] = abc;  // initial declaration of session variable.

abc.a=1;  // updated abc.a field after a button_click event

Session["abc"] = abc;   // resave the new field value of 'a' back into the session variable 'abc'.

Or does the session variable already keep track of all changes made to the object and saves automatically?


Best time to save "structure" session variable


I have a structure that groups a number of fields together that I want to use to retain values between different web pages. My plan was to transfer the structure to a session variable and retrieve it as each page loads. In theory each of the different fields could be stored in and retrieved from separate session variables but the structure approach seemed more elegant.

I was initially assuming I would be a "sensible time" (e.g. specific event) when I could consistently save the structure content to the session variable but I realise that I may be on the wrong track and that it may be necessary to transfer to the session variable to the structure each time one of the individual field values is updated as there is no way of determining when the user is about to move to another page.

Is there a solution to this or a better approach?

Setting Session variables at the time of login authentication


Dear Rahul,

I am having a website in which I am setting nearly 20 Session variables at the time of login authentication. ( Ex : Name, EmpID, Dept, Location, Email...).

Can u please tell which is one of the following is the better way to get Login user details 

 1) Through session variables at the time of login 

 2) In each and every page by calling the Stored Procedure to get login user details


Regards >> HemaBhushan 


Increase Session Time Out in WSS 3.0 Form based Authentication Site


How to increase session time out for form based authenticated shrepoint site ,

Default Sharepoint  time out is 30 min ...

I want session shuld expire after 120 min..


Crossing values of Session variables


Hi all,

We are working in a web application using Session variables to store the clients ID to operate with them in all app (making orders, reports, etc....) but randomly users get the client ID of another user in any moment using the application.

I have tried to solve it in a first step adding to system.web section in the web.config file this:

<httpRuntime enableKernelOutputCache="false"/>

No changes after this. I have tried another possible solution, changing the SessionState to StateServer:

<sessionState timeout="30" mode="StateServer" stateConnectionString="tcpip="></sessionState>

ASP.NET State Service is running in server normally, It began run just before this last change, but we have not solved the problem either with this solution.

The server is Windows Server 2003 Standard Edition SP2 32bits running IIS 6.0, and the application is made with Framework 2.0

Are we doing wrong or forget something?


in an async task session values are not getting saved when using OutProc mode



my problem is that during a page load i am starting an async task, it is a time consuming calculation. If the user requests for the task to be shown on click of a button i have to render the results or show that task is still processing. for that i am using a boolean variable which is set to true when the task starts and if on click of the button the value is still true i show processing symbol

When the async task completes i set the boolean value as false and store the calculated datatable in session. The problem is that in an inproc mode, this logic works absolutely fine. but the moment i move to state server for storing the session values, both the boolean value in session and the datatable show their initial state, i.e. the state they were in when the async task started . I checked my async task,(tried background thread and async callback delegate both methods) and they were updating the seesion values when the task was completed. But somehow the changes are not committed.

Am i missing some configueration? or is there any way i can commit the changes from async task to my session variables

Compare the values of a measure with reference to a time dimension


Hi experts, i am a novice on Analysis Services and i have this necessity:

I want to create a calculated member that compare the values of a dimension with reference to a time dimension.

Example :

Sales Year 2009   Sales year 2010   %Var

I have found this model of calc below but i not know well Analysis Services.

How can i implement this function? My time dimension named [Tempo].[Anno].[Anno] and my measure named [Measures].[Importo Neg]


// Test for current coordinate being on (All) member.



[<<Target Dimension>>].[<<Target Hierarchy>>].CurrentMember.

XML with PrimaryKey values to delete rows in database table at a time



I'm having a gridview in my aspx page with checkbox, User can select one or more than one record(s) at a time and clicks on delete button, Then i'm constructing an object of my DTO and adding all the checked row's Primary Key (DataKeyNames - GUID's in my case) to a serializable class and generating an XML and sending it as parameter to the Stored Procedure.

My Doubt is, can i bulk delete all the rows from database table those are present in my XML document??

If it works, I can do bulk update with XML only, i already did bulk insertion by generating an XML..

My Another Question is, Will it affect the performance? Each time when i construct an DTO object and adding it to the Generic List??

WHich one is better, I mean ObjectDataSource or SQLDataSource or my XML method??

Can anyone please help me out clarifying my doubts and also XML Delete Query..


My XML will be like this











Will bulk delete happen in the above case?



Session time-out : object reference not set to an instance...


I noticed that when i am debugging my web application in Visual Studio 2005 using IIS, after about 10-15 minutes of inactivity, when I do something in the application such as a postback, I get an immediate error saying: "object reference not set to an instance" and my code breaks somewhere.

Is my assumption correct that this is because my session has timed out? ( i do have a 15 minute default session time)

my next question is, how do I display or set a way so that like many other pages, when the session has expired, a message will say: "This page must be refreshed" or "Your session has expired, click okay to refresh page" and start over again?


WSDuelHttpBinding and multiple time messing between service and client in one session


i am very new in wcf.suppose my wcf service is hosted in real ip server.Clients will request to service through internet.

client will request to service.The service will authenticate the client.After receiving the request the service will do some processing(like database update,delete,insert) and send a lot amount of data to client.client will do some database action and send an acknowledgment to service.service will keep its in database as a record.I need to do it in a session  and in a transaction.How can i do this.

i choose WSDuelHttpBinding.i read about callback operation.but according to the above scenario i also need to callback to the service again to send acknowledgment . Please help me.it's urgent .




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend