ASP.NET Session management from External Application

A

amit_mitra

I Need to forcefully Abandon ASP.NET sessions from an external Windows
application or another site. Please help how can i implement this
 
M

Mark Rae [MVP]

I need to forcefully abandon ASP.NET sessions from an external Windows
application or another site.

I don't believe this is possible for individual sessions.

You could abandon all sessions by forcing your web app to recycle. There are
several ways to do this, e.g. by opening and saving its web.config...
 
A

amit_mitra

Hi Mark

I Totally aggreee with your statement. But with my recent findings I
came to know that ASP.NET can maintain the session states in a defferent
process using a state service or to a SQLServer.

If the website can communicate to that service for updating the sessions
data , why cant we ,using some external apps do that (including abonding the
sessions).

May be I am persuing it in the wrong way. Please correct me .

Regards, Amit
 
M

Mark Rae [MVP]

I Totally agree with your statement. But with my recent findings I
came to know that ASP.NET can maintain the session states in a different
process using a state service or to a SQLServer.

If the website can communicate to that service for updating the sessions
data , why cant we ,using some external apps do that (including abandoning
the
sessions).

Hmm - that's a valid point - I hadn't considered anything other than inproc
sessions.

If you use SQL Server to manage sessions, then in theory you could delete
the individual session records from the database. I have never tried this,
and am not sure if this would leave your web app in an unstable state...
 
M

Michael Nemtsev [MVP]

Hello Mark Rae [MVP],

I suppose he need to use standard SQL job "State_Job_DeleteExpiredSessions"
clear the sessions

but he need either to create the similiar SP to clear ALL session or mark
then exprired and call this JOB

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


M> M> M> Hmm - that's a valid point - I hadn't considered anything other than
M> inproc sessions.
M>
M> If you use SQL Server to manage sessions, then in theory you could
M> delete the individual session records from the database. I have never
M> tried this, and am not sure if this would leave your web app in an
M> unstable state...
M>
 
M

Mark Rae [MVP]

I suppose he needs to use standard SQL job
"State_Job_DeleteExpiredSessions" clear the sessions

Ah no, and that's the problem...

He doesn't want to clear expired sessions - he wants to forcibly terminate
current sessions...
 
A

amit_mitra

In addition to this My site works with MYSQL and Oracle. I amm looking for a
solution with ASP.NET State services.

If we can find out the API exposed by this state service for updation of
session state data, I think we can find some solutions.

Amit
 
M

Michael Nemtsev [MVP]

Hello amit_mitra,

I suppose there is no API to terminate session outside the asp.net

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


a> In addition to this My site works with MYSQL and Oracle. I amm
a> looking for a solution with ASP.NET State services. If we can find
a> out the API exposed by this state service for updation of session
a> state data, I think we can find some solutions.
a>
 
C

Coskun SUNALI [MVP]

Hi,

If both applications - web and other - can access the same database -
directly or via a WebService; you can use a basic table to store which
users' session you want to abandon and during the page loads, you can check
this table to see if you have to abandon current user's session state. And
abandon the state if the user's name is in the table and delete the row from
the table.

May sound like a workaround but looks like the most simple one.

I would also like to hear if there are some other ways to do this - not
recycling the application pool or something like that but removing the
session information for a single user.
 
A

amit_mitra

The Challenge is that I need to provide a window based monitoring tool for
Admininstrators to view and terminate the live sessions of the website.

The database solution provided by Coskun SUNALI is OK but it involves a
turnaround trip to database with each HTT request for checking its life
status.


Eliyahu Goldin said:
What is your ultimate purpose? May be there are more elegant solutions to it
than killing sessions.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


amit_mitra said:
In addition to this My site works with MYSQL and Oracle. I amm looking for
a
solution with ASP.NET State services.

If we can find out the API exposed by this state service for updation of
session state data, I think we can find some solutions.

Amit
 
C

Coskun SUNALI [MVP]

Hi,

Performance issues of course can be discussed but I was just trying to find
a solution as simple as possible.

If there is something I may help you further, please don't hesitate to ask.

--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk

amit_mitra said:
The Challenge is that I need to provide a window based monitoring tool for
Admininstrators to view and terminate the live sessions of the website.

The database solution provided by Coskun SUNALI is OK but it involves a
turnaround trip to database with each HTT request for checking its life
status.


Eliyahu Goldin said:
What is your ultimate purpose? May be there are more elegant solutions to
it
than killing sessions.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


amit_mitra said:
In addition to this My site works with MYSQL and Oracle. I amm looking
for
a
solution with ASP.NET State services.

If we can find out the API exposed by this state service for updation
of
session state data, I think we can find some solutions.

Amit



:


I suppose he needs to use standard SQL job
"State_Job_DeleteExpiredSessions" clear the sessions

Ah no, and that's the problem...

He doesn't want to clear expired sessions - he wants to forcibly
terminate
current sessions...
 
D

dev

I Need to forcefully Abandon ASP.NET sessions from an external Windows
application or another site. Please help how can i implement this

Hi,

If you are maintaining out of process session in a database. Then we
could try deleting that session from the database. We should give it a
try.

Let me know your findings.

Thanks
NET
 
M

Michael Nemtsev [MVP]

Hello dev,

it would be cool if u read all thread :) because we already discussed this
option - OP wants to store the session, but just terminate (NOT DELETE) them
at specific period of time

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


d> On Dec 27, 2:51 am, amit_mitra <[email protected]>
d> wrote:
d> d> Hi,
d>
d> If you are maintaining out of process session in a database. Then we
d> could try deleting that session from the database. We should give it
d> a try.
d>
d> Let me know your findings.
d>
d> Thanks
d> NET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top