473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9496
Howdy,

Yes and no. If you are using standard session state management, standard id
provider is used (System.Web.Ses sionState.Sessi onIDManager) which is public
so you can create and access ISessionIDManag er interface methods:

public interface ISessionIDManag er
{
// Methods
string CreateSessionID (HttpContext context);
string GetSessionID(Ht tpContext context);
void Initialize();
bool InitializeReque st(HttpContext context, bool
suppressAutoDet ectRedirect, out bool supportSessionI DReissue);
void RemoveSessionID (HttpContext context);
void SaveSessionID(H ttpContext 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.Sess ionState.Sessio nId 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.Sess ionState.Sessio nIDManager.Sess ionIDMaxLength = 80

You may create NVARCHAR(80) column for session ids

Hope this helps
--
Milosz
"rn**@rediffmai l.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
1916
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 server in a strange way, and then displays the map you asked for. It then allows you to scroll in different directions from that map. My aim is to be able to write a program that will take a street address, query the website, and return the...
7
2148
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 after 6 to 7 hours, the cookie get 2-4 new asp-sessionid's thus overwriting the very first entries in the cookie. Does anyone had the same problem or has a solution. The server is a w2003 enterprise the client has windows xp sp2.
1
1847
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
2244
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 = false Recently my asp.net app is returning wrong data to users. Users frequently get data that should only be seen by other user.
2
1498
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 this case I wish to write the SessionID to a user table in SQL Server, along with the editing user's name. As long as the session is active, all other users will be allowed read access to this data. Once the editing user exits the edit, this record...
8
2006
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 cart. I have copy / pasted the code into a new site. Everything is working, EXCEPT for the shopping cart holding the SessionID. I have watched the variable, and each time I hit the 'Update' button in a datalist, the session ID changes. That is...
4
8841
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: Session.Clear(); Session.Abandon(); FormsAuthentication.SignOut();
2
3215
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
29988
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 supposed to. The HttpResponse object always returns a different sessionID from the old one which I am trying to force. Why is objRequest not carrying over the old SessionID? private String ReadHtmlPage(string url) { String result = string.Empty;
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.