Some information relates khổng lồ prerelease hàng hóa that may be substantially modified before it’s released. makes no warranties, express or implied, with respect khổng lồ the information provided here.

Bạn đang xem: Session identification uri

public: property System::String ^ SessionID System::String ^ get(); ;public string SessionID get; thành viên this.SessionID : stringPublic ReadOnly Property SessionID As StringProperty Value String The chất lượng session identifier.


The following code example shows a Web.config tệp tin that configures session state lớn use cookieless session identifiers. For more information, see the IsCookieless property.


The SessionID property is used lớn uniquely identify a browser with session data on the hệ thống. The SessionID value is randomly generated by ASP.NET and stored in a non-expiring session cookie in the browser. The SessionID value is then sent in a cookie with each request to lớn the ASPhường.NET application.

Xem thêm: To Ta Là Gì ? So Sánh Ta Và Ota Để Xem Nên Bán Phòng Khách Sạn Ở Đâu?

If you want to lớn disable the use of cookies in your ASPhường.NET application & still make use of session state, you can configure your application khổng lồ store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element khổng lồ true, or khổng lồ UseUri, in the Web.config file for your application. You can have ASP.NET determine whether cookies are supported by the browser by specifying a value of UseDeviceProfile for the cookieless attribute. You can also have sầu ASPhường.NET determine whether cookies are enabled for the browser by specifying a value of AutoDetect for the cookieless attribute. If cookies are supported when UseDeviceProtệp tin is specified, or enabled when AutoDetect is specified, then the session identifier will be stored in a cookie; otherwise the session identifier will be stored in the URL. For more information, see the IsCookieless property.

The SessionID is sent between the hệ thống và the browser in clear text, either in a cookie or in the URL. As a result, an unwanted source could gain access to lớn the session of another user by obtaining the SessionID value & including it in requests to the server. If you are storing private or sensitive information in session state, it is recommended that you use SSL lớn encrypt any communication between the browser & VPS that includes the SessionID.

When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application"s Global.asax tệp tin and store data in the Session object to fix the session ID, or you can use code in another part of your application khổng lồ explicitly store data in the Session object.

If your application uses cookieless session state, the session ID is generated on the first page view và is maintained for the entire session.