Impersonate a user

S

Sorin Sandu

I am trying to impersonate the windows account in code like in
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158 and then all
aspx pages to run on this new account (ACL on files is only for this
account).
But after the first page when I impersonate it and I redirect to another
page the account reverse to original.
How can I do to maintain impersonation but in code not in web.config.
 
G

Guest

you need to understand that http protocol is stateless. while ASP.NET tries
to simulate statefulness, that's just all fake. when you redirect, the
current request is terminated, and the client is instructed by the server to
send another request for the new page, all the previous state, including your
impersonation is lost because the request is handled by a completely new
thread. you will need to impersonate again on the new thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top