473,396 Members | 1,671 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,396 software developers and data experts.

SessionID

Dear friends,

Line code bellow is returning message error:
Dim strSID As String = Session.SessionID.ToString
Using <%@ Page Language="VB" EnableSessionState="True" %>

Exception Details: System.Web.HttpException: Session state can only be used
when enableSessionState is set to true, either in a configuration file or in
the Page directive. Please also make sure that System.Web.SessionStateModule
or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.

web.config
<httpModules>

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

</httpModules>

Please anybody help me?

Thank you

RAMON ROCHA
from Brazil
Nov 19 '05 #1
2 3951
Pat
Try setting it in the Web.Config.
Hope that helps
Patrick

"Ramon Rocha" <te*****@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Dear friends,

Line code bellow is returning message error:
Dim strSID As String = Session.SessionID.ToString
Using <%@ Page Language="VB" EnableSessionState="True" %>

Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.

web.config
<httpModules>

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

</httpModules>

Please anybody help me?

Thank you

RAMON ROCHA
from Brazil

Nov 19 '05 #2
My mistake was used
Dim strSID As String = Session.SessionID
.... before Sub Page_Load
The session info is not available when the class System.Web.UI.Page.... is
created

Sub Page_Load(...
Dim strSID As String = Session.SessionID

It's works!
"Pat" <na********@hotmail.com> escreveu na mensagem
news:uL**************@TK2MSFTNGP14.phx.gbl...
Try setting it in the Web.Config.
Hope that helps
Patrick

"Ramon Rocha" <te*****@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Dear friends,

Line code bellow is returning message error:
Dim strSID As String = Session.SessionID.ToString
Using <%@ Page Language="VB" EnableSessionState="True" %>

Exception Details: System.Web.HttpException: Session state can only be

used
when enableSessionState is set to true, either in a configuration file or

in
the Page directive. Please also make sure that

System.Web.SessionStateModule
or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.

web.config
<httpModules>

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

</httpModules>

Please anybody help me?

Thank you

RAMON ROCHA
from Brazil


Nov 19 '05 #3

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

Similar topics

7
by: Christoph Pieper | last post by:
Hi, we've the following problem : We have an asp-application which sets the cookie on first login. The cookie will never be touched during user access. The user can work the whole day, but...
2
by: Berrucho | last post by:
Please Help! I recently posted this same issue but got no answer... please help Using VB.NET, IIS5, W2K Adv SP3 all patches, .net 1.0, VS.NET 2002 Using forms authentication, persistent cookie...
8
by: Brad Simon | last post by:
I have written a shopping cart using ASP .NET (VB). It has been running quite successfully on a site for about a year or so. I use the SessionID as the key to hold information on the shopping...
6
by: Mike Kline | last post by:
Hi There! I'm creating a HttpModule and after AcquireRequestState event, I tried to access the HttpApplication.Session.SessionID and somehow I'm getting a new value on every Refersh of ASPX...
4
by: Andy Fish | last post by:
Hi, I have an asp.net application that is using Forms Authentication and maintaining http session state using cookies in the normal way. when the user clicks the logout button I do this: ...
4
by: Kenny | last post by:
Hi, I have created an ASPX Dim ss As HttpSessionState ss = HttpContext.Current.Session HttpContext.Current.Session("tesAt") = "testValue" Response.Write(ss.SessionID() & "|<br>")...
2
by: ocean | last post by:
I want to get the session associated with the specific sissionID. I made a activex control required to login to the server.My idead as follow: 1.Get sessionID through IHTMLDocument2 interface(a COM...
2
by: XML newbie: Urgent pls help! | last post by:
If I get SessionID in 1 function how do I carry that SessionID(value of this SessionID) to another function or another form within the same project
10
by: rlueneberg | last post by:
I am trying to foward the old sessionID using "Session.SessionID" to an HttpWebRequest CookieContainer so that I can capture the requested page session variables but it is not working as it is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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,...

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.