473,804 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpApplication .Session.Sessio nID Change on Each Request. Is it Normal?

Hi There!

I'm creating a HttpModule and after AcquireRequestS tate event, I tried to
access the HttpApplication .Session.Sessio nID and somehow I'm getting a new
value on every Refersh of ASPX page.

I thought SessionID is supposed to stay static until the session timeout
defined in the web.config. Or am I missing something here???

Thanks!!

MK

Nov 19 '05 #1
6 7665
It sounds like the browser doesn't accept the session cookie. When the
server doesn't "see" an ASP-session cookie, it creates a new session.
Check your browser security settings.

Nov 19 '05 #2
"Mike Kline" <mk@nnnnnnnnnzz zzzzzzzzzzzzzzz zzzzz.zero> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi There!

I'm creating a HttpModule and after AcquireRequestS tate event, I tried to
access the HttpApplication .Session.Sessio nID and somehow I'm getting a new
value on every Refersh of ASPX page.

I thought SessionID is supposed to stay static until the session timeout
defined in the web.config. Or am I missing something here???


Does your HttpModule implement IRequireSession State?

I've seen this happen for pages which refer to SessionID but which do not
read or set Session.

John Saunders
Nov 19 '05 #3
Hi JoakimR,

Thanks for the reply! I've checked my IE setting and it is in the level of
"Accept All Cookies".

Any other ideas?

Cheers,
MK

"JoakimR" <jo************ **@cybercomgrou p.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
It sounds like the browser doesn't accept the session cookie. When the
server doesn't "see" an ASP-session cookie, it creates a new session.
Check your browser security settings.

Nov 19 '05 #4
No, my httpModule doesn't implement IRequireSession State.

The more I test it, the more I think it is not the problem with my
httpModule. Because at last, here's how I tested for the SessionID using a
normal ASPX page.

Sub Page_Load()
Response.Write( Session.Session ID.ToString())
End Sub

and everytime I refresh it, I get a new value! In the web.config file I have
<sessionState timeout="20" /> and still generating new SessionID on each
refresh.

The strange thing is that I have about 5 ASP.NET web sites currently running
and I tested on all of those websites. The result is surprisingly the Same!
How could a new SessionID be generated on each refresh????

I am absolutely hitting my head against the wall! Help!

MK

"John Saunders" <johnwsaundersi ii at hotmail.com> wrote in message
news:OU******** ******@TK2MSFTN GP09.phx.gbl...
"Mike Kline" <mk@nnnnnnnnnzz zzzzzzzzzzzzzzz zzzzz.zero> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi There!

I'm creating a HttpModule and after AcquireRequestS tate event, I tried to
access the HttpApplication .Session.Sessio nID and somehow I'm getting a
new
value on every Refersh of ASPX page.

I thought SessionID is supposed to stay static until the session timeout
defined in the web.config. Or am I missing something here???


Does your HttpModule implement IRequireSession State?

I've seen this happen for pages which refer to SessionID but which do not
read or set Session.

John Saunders

Nov 19 '05 #5
Just an update...

My server is Windows 2000. And my server names doesn't contains any
"illegal" characters such as _ (underscore).

help......

MK

"Mike Kline" <mk@nnnnnnnnnzz zzzzzzzzzzzzzzz zzzzz.zero> wrote in message
news:eW******** ******@TK2MSFTN GP12.phx.gbl...
No, my httpModule doesn't implement IRequireSession State.

The more I test it, the more I think it is not the problem with my
httpModule. Because at last, here's how I tested for the SessionID using a
normal ASPX page.

Sub Page_Load()
Response.Write( Session.Session ID.ToString())
End Sub

and everytime I refresh it, I get a new value! In the web.config file I
have <sessionState timeout="20" /> and still generating new SessionID on
each refresh.

The strange thing is that I have about 5 ASP.NET web sites currently
running and I tested on all of those websites. The result is surprisingly
the Same! How could a new SessionID be generated on each refresh????

I am absolutely hitting my head against the wall! Help!

MK

"John Saunders" <johnwsaundersi ii at hotmail.com> wrote in message
news:OU******** ******@TK2MSFTN GP09.phx.gbl...
"Mike Kline" <mk@nnnnnnnnnzz zzzzzzzzzzzzzzz zzzzz.zero> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi There!

I'm creating a HttpModule and after AcquireRequestS tate event, I tried
to
access the HttpApplication .Session.Sessio nID and somehow I'm getting a
new
value on every Refersh of ASPX page.

I thought SessionID is supposed to stay static until the session timeout
defined in the web.config. Or am I missing something here???


Does your HttpModule implement IRequireSession State?

I've seen this happen for pages which refer to SessionID but which do not
read or set Session.

John Saunders


Nov 19 '05 #6
"Mike Kline" <mk@nnnnnnnnnzz zzzzzzzzzzzzzzz zzzzz.zero> wrote in message
news:eW******** ******@TK2MSFTN GP12.phx.gbl...
No, my httpModule doesn't implement IRequireSession State.

The more I test it, the more I think it is not the problem with my
httpModule. Because at last, here's how I tested for the SessionID using a
normal ASPX page.

Sub Page_Load() Session("foo") = "bar" Response.Write( Session.Session ID.ToString())
End Sub

Try putting something into Session state before checking SessionID.

John Saunders
Nov 19 '05 #7

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

Similar topics

11
3355
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option Explicit and Response.Expires=-1,
10
7944
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into the URL, in the format http://yourapplicationpath/(Session.SessionID)/... which saves numerous headaches when it comes to storing state across page requests and sessions.
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();
13
2871
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i visit again .... null ... again .... it works ..... again ... it works ... again ..... null....... and so on and on .... it does randomly work or not.... what is this effect?
13
3843
by: Hope Paka | last post by:
I am storing user login information (not password) in the session. I also use, cookieless session. I realized that, if someone copy-pastes the URL after he/she logged in to the system to another person, the other person's browser opens as if the sender logged in. 1) Person A Logins to the system. (login information is stored in SQL Session state) 2) Person A copy-paster the url and sends it to person B (format of the url is...
9
2550
by: Adrian Parker | last post by:
We have a website that works everywhere but on a few PCs on this one site.. Asp.Net 1.1 Server = Windows 2003 Client = XP In the web.config we use - cookieless="false" in the browser settings they have "Always allow session cookies" set to true When the browser connects to the website the first page sets a session variable called "user_ref" to something and then calls another page. If on
13
9953
by: Goofy | last post by:
Does anyone know how I can kill a session by session ID ? -- Goofy
7
2970
by: David Lozzi | last post by:
Howdy, I'm trying to capture the session end event. I put a spot of code in the Session_End event in the Global.asax.vb file. The function simply writes to a database table logging the event. I have the same function in the Session_Begin and the Application events. I am capturing the Session beginning and the App begin and end but no Session end. My end goal is to capture some session objects before it dies and log it. Thanks,
3
5007
by: dihola | last post by:
Hi, I have a website running in IIS7 and it seems to be creating a new session for every request I make. The values I store in Session are lost with every request. This is the forms bit in my web.config: <authentication mode="Forms"> <forms name=".ReMaCRM" loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx" cookieless="AutoDetect" domain="" timeout="10" protection="All" /> </authentication>
0
9595
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
10604
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...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
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
6870
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
5536
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
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.