The Buddy finally got the session settled and put it in the database.

Source: Internet
Author: User

Ah, the previous system sessions were lost for some reason, and they could not be stored in the server process.

The client is always lost and then exits for no reason. You cannot set the session time to 1 hour.

Finally, I had no choice but to put the session in the database. Haha, the problem is solved.

It took one week for no customer to reflect the problem.

Maybe everyone has different requirements, but I still feel that the session is stored in the database for insurance.

The specific setting method will not be followed. I will reply.

 

Sorry, I forgot to read the post yesterday. So many friends didn't know about it. I will post the method now.

I. desktop -- start -- run -- cmd
CD to "X: \ windows \ Microsoft. NET \ framework \ v2.0.50727"
(I don't know how to operate cmd)

2. Continue writing in cmd:
Aspnet_regsql.exe-S server IP-u database login name-P Database Password-D database-ssadd-sstype C
For example
Aspnet_regsql.exe-s 127.0.0.1-U sa-P 7654321-D studentsession-ssadd-sstype C

Database to be put into: You can use the database of the system you are working on, or you can write a new database.
For example, my statement, I am working on a student system with a database student.
I want to put the session in the database studentsession.
After you execute that sentence, you can create this database. By default, there are several tables and a lot of views and stored procedures.

3. Write in Web. config

XML Code
   <sessionState mode="SQLServer"            sqlConnectionString="server=127.0.0.1; database=StudentSession ;uid=sa ;pwd=7654321;"            allowCustomSqlDatabase="True"            cookieless="false"            timeout="20" />

Do not understand the e-mail to me: woodynet@qq.com

 

 

After executing these operations, you will automatically perform operations on the database for the session operation.

Since it is automatic, you don't have to worry about it, how to insert, and how to delete it when you exit.

It is automatically completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.