473,785 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SessionID

Dear friends,

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

Exception Details: System.Web.Http Exception: Session state can only be used
when enableSessionSt ate is set to true, either in a configuration file or in
the Page directive. Please also make sure that System.Web.Sess ionStateModule
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.We b.SessionState. SessionStateMod ule"/>

</httpModules>

Please anybody help me?

Thank you

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

"Ramon Rocha" <te*****@hotmai l.com> wrote in message
news:uV******** ******@TK2MSFTN GP15.phx.gbl...
Dear friends,

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

Exception Details: System.Web.Http Exception: Session state can only be used when enableSessionSt ate is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.Sess ionStateModule 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.We b.SessionState. SessionStateMod ule"/>

</httpModules>

Please anybody help me?

Thank you

RAMON ROCHA
from Brazil

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

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

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

"Ramon Rocha" <te*****@hotmai l.com> wrote in message
news:uV******** ******@TK2MSFTN GP15.phx.gbl...
Dear friends,

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

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

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

in
the Page directive. Please also make sure that

System.Web.Sess ionStateModule
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.We b.SessionState. SessionStateMod ule"/>

</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
2147
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 after 6 to 7 hours, the cookie get 2-4 new asp-sessionid's thus overwriting the very first entries in the cookie. Does anyone had the same problem or has a solution. The server is a w2003 enterprise the client has windows xp sp2.
2
2244
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 = false Recently my asp.net app is returning wrong data to users. Users frequently get data that should only be seen by other user.
8
2005
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 cart. I have copy / pasted the code into a new site. Everything is working, EXCEPT for the shopping cart holding the SessionID. I have watched the variable, and each time I hit the 'Update' button in a datalist, the session ID changes. That is...
6
7661
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 page. I thought SessionID is supposed to stay static until the session timeout defined in the web.config. Or am I missing something here??? Thanks!!
4
8841
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: Session.Clear(); Session.Abandon(); FormsAuthentication.SignOut();
4
535
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>") Response.Write(HttpContext.Current.Session("tesAt") & "|<br>") Response.Write(HttpContext.Current.Session(ss.SessionID) & "|<br>")
2
2533
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 interface); 2.Send this value to the server; 3.Read the session associated with this sessionID and check if this session logined. Now i can get the sessionID.but don't know how to get the session by sessionID;
2
3215
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
29987
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 supposed to. The HttpResponse object always returns a different sessionID from the old one which I am trying to force. Why is objRequest not carrying over the old SessionID? private String ReadHtmlPage(string url) { String result = string.Empty;
0
9483
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10096
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,...
1
7504
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
6742
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
5386
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...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
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
3658
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.