Read and Write sessions in the ashx File

Source: Internet
Author: User

First, you must inherit the system. Web. sessionstate. ireadonlysessionstate interface.
Where: system. Web. sessionstate. ireadonlysessionstate is the read-only session interface.

However, system. Web. sessionstate. irequiressessionstate is an interface for readable and writable sessions.

1 Imports system
2 Imports system. Web
3 Imports system. Web. sessionstate
4 Public Class myverifycode: Implements ihttphandler, irequiressessionstate
7 Public   Sub Processrequest (byval Context As Httpcontext) implements ihttphandler. processrequest
8 .
9 Context. Session ( " Verifycode " ) =   " Login successful "
10 Context. response. Write (context. Session ( " Verifycode " ))
11 .
12 End sub
14 Public Readonly Property Isreusable () As   Boolean Implements ihttphandler. isreusable
15 Get
16 Return True
17 End   Get
18 End Property
20 End Class

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: 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.