9

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?

Bob
  • 22,810
  • 38
  • 143
  • 225

2 Answers2

15

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

Prashanth Thurairatnam
  • 4,353
  • 2
  • 14
  • 17
0

Session ID is ok to use its just a string with no weird characters

JohnnBlade
  • 4,261
  • 1
  • 21
  • 22