473,385 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SessionID Length

I am working on a database driven application wherein the SessionID
gets populated in a database table column.

After populatating the DB table column with several SessionIDs, I have
noticed that the length of all the SessionIDs is 24 i.e. all the
SessionIDs have 24 alphanumeric characters.

Now what I would like to know is is the length of SessionIDs ALWAYS
GUARANTEED to be 24 in ASP.NET?

Feb 28 '07 #1
1 9445
Howdy,

Yes and no. If you are using standard session state management, standard id
provider is used (System.Web.SessionState.SessionIDManager) which is public
so you can create and access ISessionIDManager interface methods:

public interface ISessionIDManager
{
// Methods
string CreateSessionID(HttpContext context);
string GetSessionID(HttpContext context);
void Initialize();
bool InitializeRequest(HttpContext context, bool
suppressAutoDetectRedirect, out bool supportSessionIDReissue);
void RemoveSessionID(HttpContext context);
void SaveSessionID(HttpContext context, string id, out bool
redirected, out bool cookieAdded);
bool Validate(string id);
}

where the most obvious member to use would be Validate(). Current (ASP.NET
2.0) implementation utilizes the internal class for generating ids
System.Web.SessionState.SessionId which defines fixed session id length 24
for cookie based session, and 26 for cookieless sessions. Have in mind future
implemenations may vary so never assume it'll always be 24. Instead, define a
public constant you can easly change in future in case internal implemenation
changes. I forgot they also defined a constant which holds maximum number of
characters that can be used in session id:
System.Web.SessionState.SessionIDManager.SessionID MaxLength = 80

You may create NVARCHAR(80) column for session ids

Hope this helps
--
Milosz
"rn**@rediffmail.com" wrote:
I am working on a database driven application wherein the SessionID
gets populated in a database table column.

After populatating the DB table column with several SessionIDs, I have
noticed that the length of all the SessionIDs is 24 i.e. all the
SessionIDs have 24 alphanumeric characters.

Now what I would like to know is is the length of SessionIDs ALWAYS
GUARANTEED to be 24 in ASP.NET?

Feb 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: C3 | last post by:
Hi everone. I'm trying to write a shell script that fetches a number of images from a map website (www.whereis.com.au). Basically, the page asks you for a street address and then queries the...
7
by: Christoph Pieper | last post by:
Hi, we've the following problem : We have an asp-application which sets the cookie on first login. The cookie will never be touched during user access. The user can work the whole day, but...
1
by: Thomas Henz | last post by:
Hi! I'm looking for a way to change the length of the generated SessionID from 24 to a higher number. Please help :) Thanks a lot, Tom
2
by: Berrucho | last post by:
Please Help! I recently posted this same issue but got no answer... please help Using VB.NET, IIS5, W2K Adv SP3 all patches, .net 1.0, VS.NET 2002 Using forms authentication, persistent cookie...
2
by: Rick Lubanovic | last post by:
I need to provide a feature which will control access to data within my ASP.Net application. This is an age old problem of locking for edit. While there are many possible ways to solve this, in...
8
by: Brad Simon | last post by:
I have written a shopping cart using ASP .NET (VB). It has been running quite successfully on a site for about a year or so. I use the SessionID as the key to hold information on the shopping...
4
by: Andy Fish | last post by:
Hi, I have an asp.net application that is using Forms Authentication and maintaining http session state using cookies in the normal way. when the user clicks the logout button I do this: ...
2
by: XML newbie: Urgent pls help! | last post by:
If I get SessionID in 1 function how do I carry that SessionID(value of this SessionID) to another function or another form within the same project
10
by: rlueneberg | last post by:
I am trying to foward the old sessionID using "Session.SessionID" to an HttpWebRequest CookieContainer so that I can capture the requested page session variables but it is not working as it is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.