0

I have floder in wwwroot that contain all the pages for a website.

the problem is that session and cookies are not save between the pages, although that the session is recognized, but always empty!

What do I have to do in order to enable session and cookies between the pages?

I tried adding this line to web.config

<authentication mode="Forms">
  <forms   cookieless="AutoDetect" domain="" timeout="10" protection="All" />
</authentication>

And I turn the folder to an Application throw the IIS manager tools.

but nothing :(

the IIS version is 7

Thanks for any help

baaroz
  • 19,119
  • 7
  • 37
  • 47

1 Answers1

0

Have you checked that session state is enabled in IIS7?

You also need to ensure that you have the session state config setting setup in your web.config in your application.

Here's an example of mine

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />

You should check out

Edit: updated the above link, the previous one was defunct.

Justin Shield
  • 2,390
  • 16
  • 12
  • Don't accept until you know it's working. It could be any of either IIS7 or the sessionstate string in your web.config. ^_^ – Justin Shield Jul 31 '11 at 23:34
  • unfortunately Those guides are not working for me ,the session state was already "in proc",additionally I added the – baaroz Jul 31 '11 at 23:58
  • You can check several things, 1 check to see if your browser is accepting cookies, I think by default the server keeps session state by sending cookies. Also check to see that you are not clearing the session state on page load. - [http://stackoverflow.com/questions/6640350/c-clear-session](http://stackoverflow.com/questions/6640350/c-clear-session) – Justin Shield Aug 01 '11 at 00:11