473,324 Members | 2,257 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,324 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 3944
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.