Sessionstate problem: "Unrecognized configuration section 'sessionstate'"

I want to set a timeout to my session within the web.config file.
And when I write down this:

        <sessionstate timeout="45"/>

I get the following error message:
Unrecognized configuration section 'sessionstate'

Can you guys help me with this?
Thanks alot.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sessionstate should be sessionState. Please note S. web.config is case sensitive.

<sessionstate... should be <sessionState...   (case sensitive)
Sorry for the echo :)
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

imagecomAuthor Commented:
now I get :

"Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS."

Did you forget to make your application as virtual directory? Open IIS, right click the application folder, click properties, in Application Settings section click on Create button.
imagecomAuthor Commented:
The configuration is set to a web site
everything is working except when i use the sessionState in web.config .

Is this all you have in the web.config or there is something more? If you have more, post the complete web.config here.
imagecomAuthor Commented:
I had 2 web.config files in my site (one in the root and one inside a library)
The problem I wrote about happened in the second one.
Once I moved the sessionState decleration to the web.config that is in the root it started working.

Do you think this was my problem all along?

Here is the original web.config that we used:

        <sessionState timeout="45"/>
       <customErrors mode="Off"/>
      <!-- Apllication Constants -->
            <add key="IsCMS"                      value="x" />
            <add key="SiteEmail"                  value="x" />
            <add key="SmtpServer"                 value="x" />
            <add key="IsOnline"                   value="x" />

Thanks again.
If you want to put a web.config in the second folder, you have to configure as virtual folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imagecomAuthor Commented:
Toda raba Amit...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.