Next SessionID After Session.abandon Is Called?

Jan 25, 2011

To avoid session fixation/hijacking we are heeding the common advice to create a new ASP.Net session for a user after authentication. Sounds simple enough. When a user authenticates we call Session.Abandon() the session ID cookie Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", "") then redirect the user.

However, how do we know on the new page that the user has logged in? We cannot check a session variable because there are none, we just started a brand new session.

I would swear, though I cannot find it now, that on this site someone explained how you can abandon a session and then get the next subsequent session ID. This way you could store that information. Then on the "Start Page" a new session would begin and that page could look up the old Session based on the new ID and validate that a user logged in.

So, are there any masters of the ASP.Net Session classes that know how to do this?

View 2 Replies


Similar Messages:

SessionID Is Still The Same After Session.Abandon Call

Sep 15, 2010

I'm writing some logging code that is based on SessionID. However, when I log out (calling Session.Abandon), and log in once again, SessionID is still the same. Basically every browser on my PC has it's own session id "attached", and it won't change for some reason. My Session config looks like this:

<sessionState
mode="InProc"
timeout="1" />

View 3 Replies

State Management :: Same SessionID Is Generated After Session.Abandon

Mar 30, 2010

How to get rid of Session.sessionID when abandoning the session?

Scenario : I abandon a session and create a new session again. This time the sessionID generated remains the same as earlier.

View 1 Replies

What Is The Difference Between Session.Abandon() And Session.Clear()

Jun 11, 2010

What is the difference between Session.Abandon() and Session.Clear() in ASP.Net?

View 1 Replies

State Management :: How To Abandon A Session From Web Service

Dec 8, 2010

on click of logout button, i want to call a web service method that will get that particular user's session and call its abandon method. But how can i pass that session variable to that web method ?

Calling of web method is done through java script.

View 3 Replies

State Management :: Session.Abandon() In Not Working In A Few Cases?

Jun 29, 2010

Session.Abandon() in not working ASP.NET 2.0 (C#) in a few cases. In the same application its working fine in other places.

< sessionState
mode="StateServer"
cookieless="false"
timeout="20" />

The session mode is "SateServer".

View 7 Replies

Setup Last Page To Clear Sessions Using Session.Abandon();

Mar 22, 2010

I have just added the following to the very last page of my application.

[Code]....

And then i have this on each of the pages before the last, within my Page_load:

[Code]....

I have different sessions thruout the application process, but this one session is only set at the beginning of the process and once i kill it on the last page, any attempt to hit Back or trying to access any page directly without first starting, i need to force them to the beginning, what am i missing or doing wrong?

sessID is set on page 1 and is available until you get to the last page. Where i added the Session.Abandon(); Now if i get to the last page and hit back before the refresh occurs, im able to go back, but the page comes up with null reference for other sessions that are obvisously cleared / killed with the abandon. So i should have to check for each session should i? I mean if the abandon killed them all, then checking for the main session should be enough right?

View 7 Replies

State Management :: How To Abandon A User's Previous Session

Jun 11, 2010

In my ASP.NET application I need to allow only one session for a user ? When a user does login more than once, I want to get to user's previous session and abandon it. I'm keeping track of all user sessions by means of session id. But Session.Abandon is available only for the current session associated with a request and not previous sessions. I have the session id of the user's previous session but how can I end it ?

View 3 Replies

Call Session.Abandon() When An Unhandled Exception Occurs?

Jan 18, 2010

In ASP.NET should we call Session.Abandon() when an unhandled exception occurs?There are many end users that hit "refresh" or "back" in the web browser in order to resubmit the request.I would like to prevent this behavior by resetting the context.TIA.

View 2 Replies

State Management :: Session Abandon - Page_load Event Not Hitting?

Mar 16, 2011

i allow my admin to login from his login page and login information verified and stored into an session after that, he visited into an client page, there is an logout button this will visible whether session has the user id or admin user id else it'll be invisible.

now the scenario is:
1. admin logged into admin page
2. then in the address bar type the client page name
3. now the client page is check whether has the userid or admin user id in Session, now the session has admin user id so, its show the Logout button.
4. from this client page, the admin clicks on Logout button, here i have Abandon the session and moved into the admin login page.5. now again admin types the same client page name in the address bar from his login page(but now he didnt logged in).6. this time i set the break point on client page_load event but its not hitting the event also its visible the Logout button also.so, how its not hitting the page_load event and why the logout button is visible after loggedout.

View 18 Replies

State Management :: How To Abandon The Session When The User Closes The Browser Window

Jan 7, 2011

How do I abandon the session when the user closes the browser window instead of pressing the logout button in ASP.Net 3.5 application.

View 5 Replies

Session.SessionID Changes Between Requests?

May 20, 2010

Why does the property SessionID on the Session-object in an ASP.NET-page change between requests?

I have a page like this:

...
<div>
SessionID: <%= SessionID %>
</div>
...

And the output keeps changing every time I hit F5, independent of browser.

I've seen this work correctly in other projects.

View 2 Replies

State Management :: How To Get Session Using SessionID

Mar 20, 2011

I'm storing the session IDs of the logged-in users in a database, so I need to kill some sessions using the session Ids stored in the database, but unfortuently I'm not able to get any session using the seesion ID so that I can kill it.

View 1 Replies

Web Forms :: Session.sessionid Returns Different Value With Each Postback?

Sep 28, 2010

I'm a bit stumped by this one. Have a VS 2008 website running on Windows 7 using the VS web server. One of the pages transfers to another page (page2). On page2, each time I cause a postback by clicking a button, I get a different session.sessionid. I was under the impression sessionid was constant throughout the session, i.e. until the browser is closed or the session expires (~20 minutes). Is this just a VS web server quirk?

View 1 Replies

How To Get Session Data With Out Having HttpContext.Current, By SessionID

May 5, 2010

I am searching to find a way to read and write on session data but with out having the HttpContext.Current.Why I won to do that ?, because I wish to make some action with the user Session after the page have been close and unloaded. For example, a user load and see a page, then I create a thread to make some action and let user go. Inside this thread I like to read the session data, but in this case HttpContext.Current is not exist any more.

So is there a way to read Session Data knowing just the session id.I store my session inside an sql server, and I see them... its there on table ASPStateTempSessions . How can I read them "offline" and manipulate them ?

View 2 Replies

State Management :: Override Sessionid / Give A Different Session Id

May 7, 2010

I hav a problem where I wanted to share session state between main page and subdomain page (example between [URL]. Naturally, in this case, the webserver will give me a different session id because the session id is bound to the domain.

But how can i override the sessionid of my main page when I come back to it?

View 3 Replies

Web Forms :: Once The User Is Successfully Logged Into Application Want To Change The Session.sessionid New?

Dec 26, 2010

i want to generate the new sessionid in the same httpcontext once the user is successfully authenticated.so, how can i do that ? ( please dont ask why do you want it, i got such kind of requirement).

View 3 Replies

C# - Stop Site Reusing Session Id On Expiry - Force A New SessionId From The Global.asax.cs File?

Sep 30, 2010

I want to be able to log when a user ends their session on our application and record whether it was a sign out or a the session expired. I am using

cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));

to set a new sessionId on sign out, but when the session expires, the sessionId is reused if the browser instance is not closed. In my web.config I have used

<sessionState mode="InProc" timeout="1" cookieName="session" regenerateExpiredSessionId="true" />

but still get sessions reused. I can't kill the cookie in Session_end() because I don't have access because there is no HttpContext or request, so I can't reset it that way. how I can force a new sessionId from the Global.asax.cs file?

View 2 Replies

Session Being Called Only Once?

Mar 22, 2011

i read that whenenver you call an instance of the your site the session_start is called. I am using the following code to create a visitor counter

void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application.Add("Myvariable", 0);
}

[Code]....

Hence when I run the program the output is "User No:1"

and i copy the url to another firefox tab and paste it there the output is still the same. Isnt it suppose to increment. My session _start is not being called why ?? I was reading a tutorial in which it is being incremented.

View 2 Replies

Web Forms :: How Come A Null Session Value That Is Called

Sep 13, 2010

how come a Null session value that is called, doesn't get directed to the Custom Error Page?

View 4 Replies

Will Application_end Be Called When All Users Session End

Aug 5, 2010

will the application_end event in global.asax gets called when all users end there session?

was it like this in the past maybe?

View 1 Replies

MVC ::Session Variables Called From The Owning Controller?

Feb 19, 2011

I'm calling an action from another controller using this code

[Code]....

But inside "ApproveOperation" action, I needed the Session variables. It seems when I called it from another controller (not the owning controller), the Session variables can not be accessed (null value).How can I get the same Session variables just like it was called from the owning controller?

View 4 Replies

State Management :: Called BindProductDetails In ProductDetails.cs - Reading Session Error?

Aug 4, 2010

I have method called BindProductDetails in ProductDetails.cs as follow.

protected void BindProductDetails(int vehicleId)
{
String sLocale=Some.DataProvider.ListData.GetCulture(System.Web.HttpContext.Current.Session["CountryCode"].ToString());

[code]....

This method returns culture ="en-US" if CountryCode passed is "US".And GetProductDetails method used in ProductDetails.cs is follow

public static Product GetProductDetails(int productId,string CountryCode,string LanguageCulture)
{
sLocale = Some.DataProvider.ListData.GetCulture(System.Web.HttpContext.Current.Session["CountryCode"].ToString());[code]....

I try to get sLocale variable to "en-US" if Countrycode passed is "US" in session.I get Object reference not set to an instance of an object error near

StringsLocale=Some.DataProvider.ListData.GetCulture(System.Web.HttpContext.Current.Session["CountryCode"].ToString()); in ProductDetails.cs page.This method works fine in all other page,but here it is showing error.If I hard code Session to US then it works fine.I think it is not reading session.

View 3 Replies

Abandon Standard Architecture And Use Lightweight Implementations?

May 10, 2010

Membership/Role/Profile providers API appeared in early days of asp.net Nearly everytime I can't live with standard API & have to add some extra functionality (for sorting, retrieving e.t.c.). I also have to use different database structure often (with foreign key to some tables for example) or think about performance improvements.

These considerations forced teams I took part in to build own providers but I can't stand to implement providers API (because we don't use 70% of standard functionality at least). Moreover, providers that were built for exact projects were rarely reused.

I wonder if someone found swiss-knife early-days-API providers implementation that is usefull for any kind of project without refactoring. Or do you use your own implementations of early-days-API's Or may be you abandon standard architecture and use lightweight implementations?

View 1 Replies

C# - Regenerate SessionID?

Mar 31, 2011

how to regenerate a new Session ID in ASP.NET. If we are using SessionManager to generate a new id then it doesn't change the value of Session.SessionID. how this can be achieved. Basically I want to have a new Session.SessionID after abandoning Session or generating NewID with SessionManager.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved