Session value is null after using Sesssion state insert in Sql Server?

Vikash kumar asked on May 6, 2016 09:21

I am trying to insert session data in sql server for that i find some solution in internet and used.

But the issue is in one page i am setting some value in session and after redirect to another page when i am checking the same session value becomes null, But when i checked in my DB value is stored for that session.

in my web.config i have used this session tag with SQLServer mode.

But when i am using the previous session tag with that i am able to get session value in another page.

Below is the Session tag in InProc Mode.

Need help asap.

Recent Answers


Roman Hutnyk answered on May 7, 2016 02:57

Are you using web farm? In this scenario you need to remove (or comment out) InProc Session tag in your web.config file and leave only SQLServer. Also you need to make sure you have machine key added to your web config and it is the same across all the web farm servers.

0 votesVote for this answer Mark as a Correct answer

Vikash kumar answered on May 9, 2016 06:37

Hi Roman,

Thanks for your reply.

I commented InProc session tag already and using only SqlServer session tag in web.config.

and for which machine key are you talking about. Could you please explain something more in this?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.