473,667 Members | 2,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session in .NET 2.0

Hi,

I am new to .net. I have created a small web application using .net 2.0 in
vs2005, where the user logs in and adds content on their pages. The content
editing is done by integrating a wysiwyg editor (FCKEditor).

The problem is that sometime if the user spends too much time editing the
content and presses the update button, the session gets timed out and the
users looses all what he has been doing. In the old days of classic ASP, i
used to increase the Session.Timeout value to a high number. But how to do
it in .NET? I would like to know some best practice example of keeping the
user session alive in .NET.

Any help is appriciated.

Tnx.
Dec 26 '07 #1
7 1551
Hi,

You can achieve changing the timeout value in "web.config " file.

You have to find the node beginning with "sessionSta te" under "<system.we b>"
node and change the value of "timeout" attribute. The value you set here is
based on "minute"s. So if its value is "20" then your session timeout value
is 20 minutes.

--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
"Jack" <no@sp.amwrot e in message
news:ux******** **********@TK2M SFTNGP05.phx.gb l...
Hi,

I am new to .net. I have created a small web application using .net 2.0 in
vs2005, where the user logs in and adds content on their pages. The
content editing is done by integrating a wysiwyg editor (FCKEditor).

The problem is that sometime if the user spends too much time editing the
content and presses the update button, the session gets timed out and the
users looses all what he has been doing. In the old days of classic ASP, i
used to increase the Session.Timeout value to a high number. But how to do
it in .NET? I would like to know some best practice example of keeping the
user session alive in .NET.

Any help is appriciated.

Tnx.
Dec 26 '07 #2
"Jack" <no@sp.amwrot e in message
news:ux******** **********@TK2M SFTNGP05.phx.gb l...
In the old days of classic ASP, I used to increase the Session.Timeout
value to a high number. But how to do it in .NET?
Same way:
http://msdn2.microsoft.com/en-us/lib...ut(VS.80).aspx
I would like to know some best practice example of keeping the user
session alive in .NET.
Sessions time out for a reason, namely to reduce the amount of memory
overhead on the webserver. As the MSDN article below states, you should
really think very carefully before increasing the timeout value...
http://msdn2.microsoft.com/en-us/library/ms525473.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 26 '07 #3
>I would like to know some best practice example of keeping the user
session alive in .NET.

Sessions time out for a reason, namely to reduce the amount of memory
overhead on the webserver. As the MSDN article below states, you should
really think very carefully before increasing the timeout value...
http://msdn2.microsoft.com/en-us/library/ms525473.aspx
I'll second that. IMO, the "best practice" for using sessions is to pass
data from one page to another on a redirect. If you need to persist data
longer than a couple of seconds, I'd put it in a DB.

Dec 26 '07 #4
Read my article on codeproject for easy solution
http://www.codeproject.com/KB/aspnet...onForever.aspx
George.

"Jack" <no@sp.amwrot e in message
news:ux******** **********@TK2M SFTNGP05.phx.gb l...
Hi,

I am new to .net. I have created a small web application using .net 2.0 in
vs2005, where the user logs in and adds content on their pages. The
content editing is done by integrating a wysiwyg editor (FCKEditor).

The problem is that sometime if the user spends too much time editing the
content and presses the update button, the session gets timed out and the
users looses all what he has been doing. In the old days of classic ASP, i
used to increase the Session.Timeout value to a high number. But how to do
it in .NET? I would like to know some best practice example of keeping the
user session alive in .NET.

Any help is appriciated.

Tnx.

Dec 26 '07 #5
Nice work-around, but you still can't control when the asp.net worker
process re-cycles. Especially in a shared host environment.

"George Ter-Saakov" <gt****@cardone .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Read my article on codeproject for easy solution
http://www.codeproject.com/KB/aspnet...onForever.aspx
George.

"Jack" <no@sp.amwrot e in message
news:ux******** **********@TK2M SFTNGP05.phx.gb l...
>Hi,

I am new to .net. I have created a small web application using .net 2.0
in vs2005, where the user logs in and adds content on their pages. The
content editing is done by integrating a wysiwyg editor (FCKEditor).

The problem is that sometime if the user spends too much time editing the
content and presses the update button, the session gets timed out and the
users looses all what he has been doing. In the old days of classic ASP,
i used to increase the Session.Timeout value to a high number. But how to
do it in .NET? I would like to know some best practice example of keeping
the user session alive in .NET.

Any help is appriciated.

Tnx.

Dec 26 '07 #6
Ideally it should never recycle.
If you have a browser hitting the SessionRenew.as px every 10 minutes then it
will not recycle due to inactivity.

If it recycles just because someone spiked CPU and hoster had to hit reset
button in shared hosting environment you doomed no matter what you do :)

But then if availability that important to you time to think about dedicated
server.

George.

"Scott Roberts" <sr******@no.sp am.here-webworks-software.comwro te in
message news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
Nice work-around, but you still can't control when the asp.net worker
process re-cycles. Especially in a shared host environment.

"George Ter-Saakov" <gt****@cardone .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Read my article on codeproject for easy solution
http://www.codeproject.com/KB/aspnet...onForever.aspx
George.

"Jack" <no@sp.amwrot e in message
news:ux******* ***********@TK2 MSFTNGP05.phx.g bl...
>>Hi,

I am new to .net. I have created a small web application using .net 2.0
in vs2005, where the user logs in and adds content on their pages. The
content editing is done by integrating a wysiwyg editor (FCKEditor).

The problem is that sometime if the user spends too much time editing
the content and presses the update button, the session gets timed out
and the users looses all what he has been doing. In the old days of
classic ASP, i used to increase the Session.Timeout value to a high
number. But how to do it in .NET? I would like to know some best
practice example of keeping the user session alive in .NET.

Any help is appriciated.

Tnx.


Dec 26 '07 #7
Ideally it should never recycle.
It does.
If you have a browser hitting the SessionRenew.as px every 10 minutes then
it will not recycle due to inactivity.
Probably due to memory - from other hacks stuffing too much crap in their
session variables.
If it recycles just because someone spiked CPU and hoster had to hit reset
button in shared hosting environment you doomed no matter what you do :)
Indeed.
But then if availability that important to you time to think about
dedicated server.
Or not use sessions. :)

Dec 26 '07 #8

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

Similar topics

2
3305
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and everything is ok. As soon as I try MS IE 6, it doesn't seem to keep the sessions from page to...
1
4369
by: mudge | last post by:
I'm running PHP Version 4.3.10. I'm trying to make it so that when a person logs in using a user name and password that their session is valid and continues for a few months so they don't have to log in each time they come to the site. In a .htaccess file I set session.cookie_lifetime to 20736000 seconds and I set session.gc_maxlifetime to 20736000 It works for about 30 minutes. A user can login and then close their browser and then...
6
2385
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an email from (possibly) three seperate forms. the following code is the end of a routine which stashes data from the first form off to session variables and then redirects itself to the proper form / procedure depending upon the state of two...
5
2447
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
0
3232
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te documentation it seems it should do it anyway any advice?
14
2369
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and User B has access to 5, now when both of us hits to the server at the same time then their session variables gets mixedup means either User A and USer B will have now 5 companies or both have 10 companies. Now again when User A hits to the server...
7
3964
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I got the exact same SessionID as of other users's. Well I guess nothing wrong with my code, do I need to set any property in Web.Config file??
0
2471
by: TRB_NV | last post by:
I'd been using an Access database based shopping cart, but wanted to change it so that it would use session variables. I have a form that's submitted to a page called addtocart.asp that contains the following information: intProdID -- ProductID strProdName -- Product Name intQuant -- Quantity intProdPrice -- Price productType -- Type of product (ie. Wine, Cheese, etc...)
1
2589
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking name of that file from attaching file page to email page through in session file .i am giving a facility of attaching five files to user . and i am taking names of both files in session variables but user attach less than five five
5
2429
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
8458
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8366
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8888
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8565
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7391
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2779
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
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.