Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Session state
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Session state

 Post Reply Post Reply
Author
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Topic: Session state
    Posted: 24 April 2004 at 4:29pm
Hi guys,

I am trying to use the session state in an applicaton. But the problem is that when I try to do

Private Host As String = Session("Server")

I get the following error:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive

So then I changed the session region of my web.config from:
<sessionState
         &nbs p;  mode="InProc"
         &nbs p;  stateConnectionString="tcpip=127.0.0.1:42424"
         &nbs p;  sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
         &nbs p;  cookieless="true"
         &nbs p;  timeout="20"
    />

To:
<sessionState
            enableSessionState="true"
         &nbs p;  mode="InProc"
         &nbs p;  stateConnectionString="tcpip=127.0.0.1:42424"
         &nbs p;  sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
         &nbs p;  cookieless="true"
         &nbs p;  timeout="20"
    />

But then I get the following error:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'enableSessionState'.

Source Error:

Line 70:           To disable cookies, set sessionState cookieless="true".
Line 71: -->
Line 72: <sessionState
Line 73: enableSessionState="true"
Line 74: mode="InProc"

Can anyone shine some light on the subject? Thanks, Mart.
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2004 at 4:34pm
P.s. It doesn't work if I put it in the page directive either... Seems to ignore it.
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2004 at 4:23am

<%@ Page Language="VB" EnableSessionState="True" %> Doesn't work? Wtf?

I read this somewhere

Use System.Web.HttpContext.Current.Session to refer to the session instance for the current http request instead of the Session Keyword.
System.Web.HttpContext.Current.Session provides you with the System.Web.HttpSessionState instance for the current HTTP request.

http://www.visual-basic-data-mining.net/Forum/showpost.aspx? PostID=1373



Edited by Diep-Vriezer
Gone..
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.