Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the string format of the Asp.net SessionID?

I want to use the Session.SessionID as file name and query string in URL. I want to know if its format is suitable for these applications. For example you can not use '?' or '<' characters in a file name.

Is SessionID format string safe for file names and query strings?

like image 726
Bobs Avatar asked Jul 04 '12 10:07

Bobs


People also ask

What is ASP.NET SessionID cookie?

About SessionID and Cookies At the beginning of a new session, the server stores the Session ID in the user's Web browser as a cookie. The SessionID cookie is similar to a locker key in that, as the user interacts with an application during a session, ASP can store information for the user in a "locker" on the server.

Where does ASP.NET store SessionID?

By Default Session Id is Stored in Client m/c in the form of text file.It is Called Cookie. If session is Cookie less the that is append to Url . In Cookies.

What is the use of ASP NET_SessionId?

Net_SessionId is a cookie which is used to identify the users session on the server. The session being an area on the server which can be used to store data in between http requests.

How does ASP.NET MVC session work?

The server reads the SessionId which was sent by the client in question 1. The server maintains for example a key value data object so it can load the right data for the given SessionId . ASP MVC doesn't use a viewstate since it's a completely different approach than ASP.NET.


1 Answers

From this MSDN link

"The ASP.NET session identifier is a randomly generated number encoded into a 
 24-character string consisting of lowercase characters from a to z and numbers 
 from 0 to 5."

So the answer is, Yes & it's safe to be used for file names and query strings

like image 74
Prashanth Thurairatnam Avatar answered Sep 24 '22 02:09

Prashanth Thurairatnam