473,408 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

ENABLESESSIONSTATE and Global.asa

I have an asp page in which first line is

<@ ENABLESESSIONONSTATE = false %>

I want to stop the sessions for this page. I have global.asa page whose code
is like this

<SCRIPT RUNAT=Server Language=VBScript>
Sub Session_OnStart
Session("XYZ") = False
Session("ABC") = true
End Sub
</script>

When IIS is restarted and hit my asp page it goes to global.asa
session_onStart though I have disabled sessions on my page.

I dont want to execute global.asa at all when session is disabled on the
page....I get this wrong behavior only when IIS is restarted and page is hit
for the first time....for successive hits it doesnt go to global.asa and
keeps the session disable on the page....

I have tested for this 2 scenarios and I get the satisfactory results as per
my desire

1. u create a web application in IIS and disable session (by unchecking
"Enable Session State") , the page does not go to global.asa
2. if you dont create a web application and keep just a folder or a virtual
directory then the page does not go to global.asa

any clues why it goes to global.asa in other cases.

thanks
Jul 22 '05 #1
4 4312
My first line in my asp page is as below

<%@ EnableSessionState = False %>

[in earlier post I had typed it wrong but my code has correct line as above.
Still my issue is the same as per previous post]

"abcd" <ab**@abcd.com> wrote in message
news:ej**************@tk2msftngp13.phx.gbl...
I have an asp page in which first line is

<@ ENABLESESSIONONSTATE = false %>

I want to stop the sessions for this page. I have global.asa page whose
code is like this

<SCRIPT RUNAT=Server Language=VBScript>
Sub Session_OnStart
Session("XYZ") = False
Session("ABC") = true
End Sub
</script>

When IIS is restarted and hit my asp page it goes to global.asa
session_onStart though I have disabled sessions on my page.

I dont want to execute global.asa at all when session is disabled on the
page....I get this wrong behavior only when IIS is restarted and page is
hit for the first time....for successive hits it doesnt go to global.asa
and keeps the session disable on the page....

I have tested for this 2 scenarios and I get the satisfactory results as
per my desire

1. u create a web application in IIS and disable session (by unchecking
"Enable Session State") , the page does not go to global.asa
2. if you dont create a web application and keep just a folder or a
virtual directory then the page does not go to global.asa

any clues why it goes to global.asa in other cases.

thanks

Jul 22 '05 #2
"abcd" <ab**@abcd.com> wrote in message
news:ej**************@tk2msftngp13.phx.gbl...
I have an asp page in which first line is

<@ ENABLESESSIONONSTATE = false %>

I want to stop the sessions for this page. I have global.asa page whose
code is like this

Hi,

To avoid hitting global.asa you should disable the session using the IIS
management console.

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

<SCRIPT RUNAT=Server Language=VBScript>
Sub Session_OnStart
Session("XYZ") = False
Session("ABC") = true
End Sub
</script>

When IIS is restarted and hit my asp page it goes to global.asa
session_onStart though I have disabled sessions on my page.

I dont want to execute global.asa at all when session is disabled on the
page....I get this wrong behavior only when IIS is restarted and page is
hit for the first time....for successive hits it doesnt go to global.asa
and keeps the session disable on the page....

I have tested for this 2 scenarios and I get the satisfactory results as
per my desire

1. u create a web application in IIS and disable session (by unchecking
"Enable Session State") , the page does not go to global.asa
2. if you dont create a web application and keep just a folder or a
virtual directory then the page does not go to global.asa

any clues why it goes to global.asa in other cases.

thanks


Jul 22 '05 #3
Theortically it says that when a page includes EnableSessionState = false it
stops the session though Session is enabled in IIS management
console....then why this is not happening for that page after IIS
restart....

thanks
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalid> wrote in
message news:ug**************@TK2MSFTNGP10.phx.gbl...
"abcd" <ab**@abcd.com> wrote in message
news:ej**************@tk2msftngp13.phx.gbl...
I have an asp page in which first line is

<@ ENABLESESSIONONSTATE = false %>

I want to stop the sessions for this page. I have global.asa page whose
code is like this

Hi,

To avoid hitting global.asa you should disable the session using the IIS
management console.

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

<SCRIPT RUNAT=Server Language=VBScript>
Sub Session_OnStart
Session("XYZ") = False
Session("ABC") = true
End Sub
</script>

When IIS is restarted and hit my asp page it goes to global.asa
session_onStart though I have disabled sessions on my page.

I dont want to execute global.asa at all when session is disabled on the
page....I get this wrong behavior only when IIS is restarted and page is
hit for the first time....for successive hits it doesnt go to global.asa
and keeps the session disable on the page....

I have tested for this 2 scenarios and I get the satisfactory results as
per my desire

1. u create a web application in IIS and disable session (by unchecking
"Enable Session State") , the page does not go to global.asa
2. if you dont create a web application and keep just a folder or a
virtual directory then the page does not go to global.asa

any clues why it goes to global.asa in other cases.

thanks

Jul 22 '05 #4
"abcd" <ab**@abcd.com> wrote in message
news:ui**************@TK2MSFTNGP12.phx.gbl...
Theortically it says that when a page includes EnableSessionState = false
it stops the session though Session is enabled in IIS management
console....then why this is not happening for that page after IIS
restart....

This is by design because global.asa cannot know that **all** or just a
**few** pages have the sessionstate turned of.
the ASP framework, therefore, always creates a session cookie. After that,
it is not reused in your case.

Only by disabling it by the IIS it is disabled for global.asa as well.
And the enablesessionstate = false does not work for global.asa (might not
be documented...).

Success
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

thanks
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalid> wrote in
message news:ug**************@TK2MSFTNGP10.phx.gbl...
"abcd" <ab**@abcd.com> wrote in message
news:ej**************@tk2msftngp13.phx.gbl...
I have an asp page in which first line is

<@ ENABLESESSIONONSTATE = false %>

I want to stop the sessions for this page. I have global.asa page whose
code is like this



Jul 22 '05 #5

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

Similar topics

0
by: John Baughman | last post by:
I am attempting to move my asp.net application to Windows Server 2003 with Windows Sharepoint Services (beta) installed. The application was working fine in 2000 with Sharepoint Team Services...
0
by: Brad | last post by:
Hello Everyone, I was wondering if the following line at the top of my global.asa file is legal: <SCRIPT @ENABLESESSIONSTATE = FALSE LANGUAGE = VBSCRIPT RUNAT = SERVER> It does not produce...
0
by: Brad | last post by:
Hello Everyone, I was wondering if the following line at the top of my global.asa file is legal: <SCRIPT @ENABLESESSIONSTATE = FALSE LANGUAGE = VBSCRIPT RUNAT = SERVER> It does not produce...
2
by: Marco Gerlach | last post by:
Hello, on IIS6 running on Win2003 server std. I get this error "enablesessionstate Page directive is needed to use the Session object" my web.config looks like this:
6
by: Martin | last post by:
Hi, I had a page the other day for which the compiler just wouldn't recognize the fact that I had enabled session state in every possible way. I ended up moving the code that dealt with the...
3
by: David Lozzi | last post by:
Error: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive at line 6 Line 4: <script RUNAT="SERVER"> Line 5: ...
3
by: Sean W. | last post by:
I keep getting this error. "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive" This occurs when I try to add a...
1
by: user_me | last post by:
I have a page with function 'myFunction()' that contains a call to window.setTimeout("myFunction()", delay, "javascript") to invoke itself every 'delay' minutes. The function 'myFunction()' uses...
6
by: KevinGravelle | last post by:
What is wrong with this picture? I'm trying to set my shopping cart text on my home page using the following function that is executed when the class is constructed: protected string...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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
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
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...

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.