Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ENABLESESSIONSTATE and Global.asa

Reply
Thread Tools

ENABLESESSIONSTATE and Global.asa

 
 
abcd
Guest
Posts: n/a
 
      07-20-2005
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


 
Reply With Quote
 
 
 
 
abcd
Guest
Posts: n/a
 
      07-20-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>



 
Reply With Quote
 
 
 
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      07-20-2005
"abcd" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>


 
Reply With Quote
 
abcd
Guest
Posts: n/a
 
      07-20-2005
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)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> "abcd" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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
>>
>>

>



 
Reply With Quote
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      07-22-2005
"abcd" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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)" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> "abcd" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EnableSessionState=readonly and difference between InProc and StateServer mode Jeffry van de Vuurst ASP .Net 0 05-18-2004 10:18 AM
Repost: Global.asa and EnableSessionState Brad ASP General 0 10-21-2003 06:21 PM
Global.asa and EnableSessionState Brad ASP General 0 10-16-2003 09:06 PM
RE: Can't use Session in ASP.NET - enableSessionState error Jim Cheshire [MSFT] ASP .Net 3 08-04-2003 04:27 PM
enablesessionstate Page directive is needed to use the Session object Marco Gerlach ASP .Net 2 07-18-2003 10:27 AM



Advertisments