473,657 Members | 2,700 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 1897
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****@nospamc harter.net> wrote in message
news:el******** ******@TK2MSFTN GP12.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******@takem pis.com> wrote in message
news:el******** ******@TK2MSFTN GP10.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****@nospamc harter.net> wrote in message
news:el******** ******@TK2MSFTN GP12.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****@nospamc harter.net> wrote in message
news:eu******** ******@TK2MSFTN GP10.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.saunder s at SurfControl.com > wrote in message
news:#V******** ******@TK2MSFTN GP10.phx.gbl...
"Jim Corey" <jc****@nospamc harter.net> wrote in message
news:eu******** ******@TK2MSFTN GP10.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
6843
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 { public void Draw() { Console.WriteLine("The WINDOW Draw method is running!");
5
2608
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 classes yClass which inherits xClass. xClass has a virtual method which simply writes a line of text stating its origin, yClass implements the same method which writes a line of text stating its origin also (i.e. "From yClass"). I ran the...
5
9593
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; otherwise, Hashtable might not work correctly." Does any one know, why we must also override Equals, Please give my an example:) Thanks, Stoyan
2
4051
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 PropertyGrid when I use my subclass as a type converter. Can anyone tell me what has changed? What's the correct way to override GetProperties method? Here's the code for my class:
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.
8
5483
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 all applications will use sessions and to insure that all application use this method, the session properties cannot be overriden. Within the sessionstate tags, the webadmin (upon my request)r emoved the property for timeout, hoping that...
1
2228
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 behaviour of resetting the timeout everytime that page refreshes, so that if the user sits on that page without activity for more than 20 minutes, the site still times out? I am not looking to implement any page specific javascript solution, rather...
3
2259
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 and logic, there are times when I need to set a particular visitor's session to use the URL encoding (CookieMode.UseUri) instead of using cookies. Yes I know there is an auto type setting but that is not applicable to our needs. There are also...
3
1849
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 class Lib and inharite from "page" . but what should i write in the fuction "public override HttpSessionState
0
8739
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
8512
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
8612
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
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
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
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
1969
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.