473,405 Members | 2,334 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,405 software developers and data experts.

How to force a New Session and SessionID

I have an app that uses the sessionID to track user navigation and usage
through the application.

It works fine except in one case:
There is a point in the application where I want to "close" the user's
tracking and handle the user as if he had just logged on. To do that, I need
a new sessionID. But even if I call Session.Abandon(), the user's SessionID
does not change -- it just dumps session values.

How can I force a new sessionID at some point in the application? Or must I
think of a different way of creating an ID to track the user in the
application?

Thanks
Nov 19 '05 #1
2 4253
I am assuming you are using the SessionID to track something else. In this
case, use another ID created by you, and store that as a session variable.
When you abandon the session, this session variable will be gone, and you
will need to create another one. Now you have a new unique ID to use.

"Hardin" <Ha****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
I have an app that uses the sessionID to track user navigation and usage
through the application.

It works fine except in one case:
There is a point in the application where I want to "close" the user's
tracking and handle the user as if he had just logged on. To do that, I
need
a new sessionID. But even if I call Session.Abandon(), the user's
SessionID
does not change -- it just dumps session values.

How can I force a new sessionID at some point in the application? Or must
I
think of a different way of creating an ID to track the user in the
application?

Thanks

Nov 19 '05 #2

"Hardin" <Ha****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
I have an app that uses the sessionID to track user navigation and usage
through the application.

It works fine except in one case:
There is a point in the application where I want to "close" the user's
tracking and handle the user as if he had just logged on. To do that, I
need
a new sessionID. But even if I call Session.Abandon(), the user's
SessionID
does not change -- it just dumps session values.

How can I force a new sessionID at some point in the application? Or must
I
think of a different way of creating an ID to track the user in the
application?

Thanks


If I remember correctly, the Session.Abandon method does indeed work
correctly, but not as you would think it would. When you call
Session.Abandon, it will abandon the Session as soon as the current request
is completed. So, something like the following snippet should help:

Session.Abandon()
Response.Redirect(Request.Path) ' Can't remember exact property of Request
to get the current file's path.
HTH,
Mythran

Nov 19 '05 #3

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

Similar topics

1
by: Savas Ates | last post by:
im adding users in my database with theirs session.sessionid with this id i also add some products in my db .. but server can create same session.sessionid So , my records can be complex .. i...
5
by: Eugene Anthony | last post by:
In my login.asp I have the following code: <!--#include file="database_Function.asp"--> <% Dim sSessionID, sMessage If Len(Request.Form("cmdSubmit")) > 0 then mySQL = "EXECUTE...
8
by: Dave Wurtz | last post by:
All, I'm new to ASP development and I have a basic design question: Is it ok to store business objects to session variables or is there a better way to keep object information? For example,...
4
by: Chris | last post by:
When a request comes into a page on my ASP.net site and a session is not found, I want to detect whether the request is an initial request or if the user did have a session going that has now been...
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: ...
3
by: dotnettester | last post by:
Hi, Is there a way, I can get a new sessionid without user closing the browser window? I have a webpage, which logs user input and sessionid. If the user does not close the browser and if...
2
by: ocean | last post by:
I want to get the session associated with the specific sissionID. I made a activex control required to login to the server.My idead as follow: 1.Get sessionID through IHTMLDocument2 interface(a COM...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
7
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.