473,320 Members | 1,965 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,320 software developers and data experts.

Forms authentication - how to retrieve logged-in username?

I've got Forms Authentication up and running. The starting page for the app.
is default.aspx. I want to display on the top of this form a 'You are logged
in as Fredxyz' message.

If the user is a return user and was automatically logged in by a persistent
auth. cookie, how can I find out the 'username' that he's logged in as?

Thanks,

Paul.
Nov 18 '05 #1
1 2015
The HttpContext.Current.User.Identity.Name will return the value that has
been set for the name field. Howevery, this is often just an ID number or
something else. You can create your own identity class based on the
IIdentity interface. You can also generate a custom ticket to pass with the
forms authentication. This has the benefit of having custom data stored in a
custom data field for the ticket that could be used to store the user's
name.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Paul W" <qq*@qqq.com> wrote in message
news:ee**************@TK2MSFTNGP14.phx.gbl...
I've got Forms Authentication up and running. The starting page for the
app. is default.aspx. I want to display on the top of this form a 'You are
logged in as Fredxyz' message.

If the user is a return user and was automatically logged in by a
persistent auth. cookie, how can I find out the 'username' that he's
logged in as?

Thanks,

Paul.

Nov 18 '05 #2

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

Similar topics

1
by: Lamberti Fabrizio | last post by:
I've an authentication problem with IServerXMLHTTPRequest. I've got two web server named WS_1 and WS_2 part of the same NT domain. On WS_1 I've published on the virtual directory virt1 the asp...
5
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
1
by: TK | last post by:
What's the best way to implement roll-base access control with forms authentication? I have a IIS6+ASP.NET server which hosts some ASP.NET web applications as separated path that's like...
1
by: TK | last post by:
What's the best way to implement roll-base access control with forms authentication? I have a IIS6+ASP.NET server which hosts some ASP.NET web applications as separated path that's like...
2
by: ThatsIT.net.au | last post by:
I am using Forms Authentication but I want to keep more info on user than forms authentication keeps. I thought of 2 ways of doing this 1. To have a linked table holding other data, but for this I...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.