473,769 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FBA & Session State

I use forms based authentication and I've been putting the username in
Session State (Session["UserName"]).

Then when a user posts I check that Session["UserName"] != null else I
Session.Abandon () and Response.Redire ct("logon.aspx" ) since that seems like
a graceful way to handle timeouts, session state losses (bin directory was
updated for example).

This doesn't seem like a reliable way to do it though. I get weird things
happening like SOMETIMES if I close the browser, then re-open a link I can
access the page without logging in but then when I post (ie I hit submit or
such) it asks me to logon.

How should I be handling this.
Nov 18 '05 #1
1 1393
You should really consider reading up on "Forms authentication" in asp.net.
That allows you to provide a login.aspx, handles timeouts, handles many of
the customizations. .

"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:Oy******** ******@TK2MSFTN GP12.phx.gbl...
I use forms based authentication and I've been putting the username in
Session State (Session["UserName"]).

Then when a user posts I check that Session["UserName"] != null else I
Session.Abandon () and Response.Redire ct("logon.aspx" ) since that seems like a graceful way to handle timeouts, session state losses (bin directory was
updated for example).

This doesn't seem like a reliable way to do it though. I get weird things
happening like SOMETIMES if I close the browser, then re-open a link I can
access the page without logging in but then when I post (ie I hit submit or such) it asks me to logon.

How should I be handling this.

Nov 18 '05 #2

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

Similar topics

1
1525
by: Nikander Bruggeman | last post by:
I keep losing session state when I store UIPAB state in the SessionStateObject. The asp.net session state object itself stores it's state in SQL server, I'm using cookieless session state. This strange behavior occurs in a load balanced environment consisting of 2 web servers. The next part is taken from the web.config file: <sessionState
6
2456
by: Jason Shohet | last post by:
2 questions for anyone who can answer: 1. in class declarations, I realize you have to use the NEW keyword if you want to declare & instantiate some class at the same time. Whats an advantage for just declaring at the top of say, an aspx page, and then instantiating when you need it in various functions in the page? 2. I can't seem to figure out a way to use the NEW keyword to instantiate a class coming from a session object. ie,...
3
342
by: Jeremy | last post by:
I am relativly new to ASP.NET, and my question is this: Is it better to create a wrapper class that contains all the running settings for the application and then load that into the app state, or is it better to load the scalar variables and store them individually? In case I'm not making my self clear, is it better to do this: '// Load each variable individually Context.Cache.Add( "UserFirstName", txtFirstName.Text ... )
2
2186
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the relevant criteria ? is the primary criteria max expected total storage size (for all active sessions) versus max ram available on the state-server machine ? if ADO.NET objects (such as small DataTables) must be stored in session-state , is any...
1
2410
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of the differences, e.g that every object you store in SQLSession state have to be serializable, but other differences are very unfortunate.
2
2039
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each app individually, only one of the servers seems to return this error when I step through a sequence. I was told that I'm trying to store an object not marked as Serializable but I've tested this on a dev machine storing session variables without...
2
1446
by: glenn | last post by:
Hi folks, I must be missing something here. I have an ASP page that I create a Session variable in as follows. Session ("name")="Joe" In an ASP.NET page in the same project and the same session, I call the Session variable as follows:
11
3659
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each method has the WebMethodAttribute.EnableSession set to true. When I run the test page the session is maintained. However, using a console application, in between setting the string value and attempting to
2
1432
by: =?Utf-8?B?VW1lc2huYXRo?= | last post by:
Hi, My application is running with two web server let say W1 & W2 and load balance controls the request to web servers . One of my application page pop up a new page and there I am using Context.User prpoerty to get current user informtaion and convert into my customer class which lot of customer information . This works fine in Developement environment and when it moves to production some times the customer class is not getting...
0
9422
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
10208
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
9857
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
8867
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
6662
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
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
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
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
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.