Solved

Read ASP.NET Forms Authentication cookie from classic ASP?

Posted on 2004-09-01
5
724 Views
Last Modified: 2013-12-30
I'm using ASP.NET forms authentication to write a cookie containing the currently logged in username:

<authentication mode="Forms">
         <forms name=".ASPXINTRANETAUTH" loginUrl="/login.aspx" protection="All" timeout="60" />
</authentication>
<authorization>
           <allow users="*" />
</authorization>

My login.aspx page creates the cookie with this command:
FormsAuthentication.RedirectFromLoginPage(Username.Value, PersistCookie.Checked);

MY QUESTION: Is there a way to access the username stored in the cookies using Classic ASP?  I want users to be able to login using the ASP.NET app, but I also want them to be able to access legacy ASP apps which I plan to re-code to use the currently logged in username supplied by the ASP.NET cookie.

I looked at the cookie contents, and I can't make out a username from it:

.ASPXINTRANETAUTH
4F3FD9C282F1B7CFFAC07AC7469550E5ECFD31584D6CE3D461A371F83B16A9E30DCB066 818C61F8F46C8F50A46ABEE6C5497F7179EB4716088F7A6B3CC59C8037E0A52FF20922B52
test_server/
1024
394652160
33332915
688688176
29659219
*

Security isn't of utmost importance for this app.

Thanks,
Daniel
0
Comment
Question by:hendridm
5 Comments
 
LVL 9

Accepted Solution

by:
Rodney Helsens earned 450 total points
ID: 11956721
The value is encoded..you should be able to decode the cookie via VBScript, take a look at this
http://blogs.x2line.com/al/articles/146.aspx
0
 
LVL 33

Expert Comment

by:raterus
ID: 11956870
Well you don't have to use that authentication cookie with Forms Authentication, in fact, if security isn't that much of an issue, you can create your own cookie that forms authentication will use.  Then you can keep the username cleartext.
0
 

Expert Comment

by:alejandrorivera
ID: 39746671
this link is broken
http://blogs.x2line.com/al/articles/146.aspx

any chance you can post the solution here?
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question