473,503 Members | 13,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Override session object?


I've just learned that the app I've been working on is
going to be deployed to a web farm.

The app uses session variables, and I've been told that I want to use
some other technique.

I was wondering if there is a way to override the session object so that
I could leave most of the current code intact. Then
for the time being I could do what I want in this override section of
code.

I only have one page in the app, and this inherits from a base page.

TIA,
Jim
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
5 1892
Use SQL Server to store Session data. The same SQL Server can be assigned
for all machines in the Web Farm, and you won't have any issues except for
possible serialization issues with some of the stuff you're storing. When
using SQL Server to store Sessions, all Session objects must be
serializable.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jim Corey" <jc****@nospamcharter.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...

I've just learned that the app I've been working on is
going to be deployed to a web farm.

The app uses session variables, and I've been told that I want to use
some other technique.

I was wondering if there is a way to override the session object so that
I could leave most of the current code intact. Then
for the time being I could do what I want in this override section of
code.

I only have one page in the app, and this inherits from a base page.

TIA,
Jim
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
When Kevin says, "use SQL Server", he means that you should set
<sessionState mode="SQLServer" /> in your web.config.

--
John Saunders
John.Saunders at SurfControl.com
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...
Use SQL Server to store Session data. The same SQL Server can be assigned
for all machines in the Web Farm, and you won't have any issues except for
possible serialization issues with some of the stuff you're storing. When
using SQL Server to store Sessions, all Session objects must be
serializable.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jim Corey" <jc****@nospamcharter.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...

I've just learned that the app I've been working on is
going to be deployed to a web farm.

The app uses session variables, and I've been told that I want to use
some other technique.

I was wondering if there is a way to override the session object so that
I could leave most of the current code intact. Then
for the time being I could do what I want in this override section of
code.

I only have one page in the app, and this inherits from a base page.

TIA,
Jim
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #3

Well, my intention is not to use sqlserver.
Evidently the explanation here means that I could go to sqlserver
without changing the code.

But I was hoping that I could write my own code to override
the session object and then save the variables to viewstate or a hidden
html field in the new code for the override and
leave the rest of the code intact.

Jim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
"Jim Corey" <jc****@nospamcharter.net> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...

Well, my intention is not to use sqlserver.
Evidently the explanation here means that I could go to sqlserver
without changing the code.

But I was hoping that I could write my own code to override
the session object and then save the variables to viewstate or a hidden
html field in the new code for the override and
leave the rest of the code intact.


I'm sure you could do this, but why reinvent the wheel? Microsoft has
already invented a variety of wheels, and they test them, too!
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #5
In addition to John's excellent advice, a good rule of thumb is, let
Microsoft manage as much of your stack as possible. Whatever part of your
stack you build, you have to manage. Whatever part of your stack Microsoft
builds, they have to manage.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"John Saunders" <john.saunders at SurfControl.com> wrote in message
news:#V**************@TK2MSFTNGP10.phx.gbl...
"Jim Corey" <jc****@nospamcharter.net> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...

Well, my intention is not to use sqlserver.
Evidently the explanation here means that I could go to sqlserver
without changing the code.

But I was hoping that I could write my own code to override
the session object and then save the variables to viewstate or a hidden
html field in the new code for the override and
leave the rest of the code intact.


I'm sure you could do this, but why reinvent the wheel? Microsoft has
already invented a variety of wheels, and they test them, too!
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #6

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

Similar topics

5
6832
by: Darius | last post by:
I'm writing here in hopes that someone can explain the difference between the new and virtual/override keywords in C#. Specifically, what is the difference between this: public class Window {...
5
2582
by: Mark Broadbent | last post by:
Oh yes its that chestnut again! Ive gone over the following (http://www.yoda.arachsys.com/csharp/faq/ -thanks Jon!) again regarding this subject and performed a few of my own tests. I have two...
5
9573
by: Stoyan | last post by:
Hi All, I don't understand very well this part of MSDN: "Derived classes that override GetHashCode must also override Equals to guarantee that two objects considered equal have the same hash code;...
2
4039
by: Adriano Coser | last post by:
Hello. After I converted my .net code to the new VC2005 syntax I started to get C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties method is no longer called by the...
5
2432
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...
8
5469
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
1
2217
by: RUSSELL MCGINNIS | last post by:
I have a web site that uses Form Authentication with the Session timeout set to 20 minutes, however one of the pages refreshes itself every 30 seconds. Is there a way to override the session...
3
2250
by: Steve Franks | last post by:
Can someone please advise on how I can add logic that dynamically sets the session state's cookie mode to UseUri or UseCookies on a per user basis? In other words, depending on our business rules...
3
1844
by: rony_16 | last post by:
hi , i want to override the object session in class page , because i want to check the Session automaticly in WebForm , without writing "if" in evry page . i know that i need to make a new...
0
7213
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,...
0
7098
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...
0
7298
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,...
0
7366
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...
1
7017
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...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
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,...
0
1526
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 ...
1
754
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.