Solved

Read ASP.NET Forms Authentication cookie from classic ASP?

Posted on 2004-09-01
5
713 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
Comment Utility
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
Comment Utility
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
Comment Utility
this link is broken
http://blogs.x2line.com/al/articles/146.aspx

any chance you can post the solution here?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now