开发者

Set Authentication Cookie via ASP.Net Page Method. Possible?

I have an ASP.Net page with a page method which accepts the username and password and开发者_StackOverflow validates the user. Since its a page method the username and password is sent to the server with the use of javascript in the usual way page methods are called.

Is it possible to set an authentication cookie in some way so that all subsequent page requests identify themselves as the logged in user? or isn't page methods the way to go when authenticating users?


You can set an authentication cookie with FormsAuthentication.SetAuthCookie.

Without knowing your specific needs (is this needing to be done on an AJAX request or not) you can call it in any code behind method as normal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜