Why am i not getting a session ID cookie??

S

spitapps

I want to have sessions on my website, this is my web.config file:

<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<sessionState mode="InProc" cookieless="UseCookies" timeout="20"
cookieName="whatever"></sessionState>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>



Is there any reason why when i run the web app i dont get a session
cookie?? I have even tried starting with a blank website and added a
web.config file just for sessions, and I still dont get any session
cookie. Also when i use Fiddler in IE to see the requests and
responses i dont see a mangled URL with a session ID. Thanks in
advance
 
J

Juan T. Llibre

re:
!> <sessionState mode="InProc" cookieless="UseCookies" timeout="20"
!> cookieName="whatever"></sessionState>
!> Is there any reason why when i run the web app i dont get a session cookie?

http://msdn.microsoft.com/library/d...us/cpgenref/html/gngrfSessionstateSection.asp

1. The cookieless setting must be either "true" or "false".

2. cookieName isn't a sessionState setting.

3. you're closing the sessionState element improperly.
</sessionState> isn't the correct way to close the sessionState element.

If you want to use cookies and InProc, use:

<sessionState mode="InProc" cookieless="false" timeout="20" />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,286
Latest member
ChristieSo

Latest Threads

Top