在asp.net会员中将用户设置为在线 [英] Set user as online in asp.net membership

查看:58
本文介绍了在asp.net会员中将用户设置为在线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户使用选项(记住我)并关闭浏览器并再次打开网站时,他将不会出现在线会员。



怎么能重新打开网站后我将用户设置为在线?



i使用此代码:

When the user uses the option (Remember Me) and close the browser and he opens the site again, he will not appear with online members.

how can i set a user to online after reopen site again?

i use this code:

Membership.GetNumberOfUsersOnline();



但在线返回0



谢谢


but it returns 0 online

thank you

推荐答案

选项记住我通常会保留cookie中的登录详细信息。

一旦用户访问您的网站,您可以从cookies中检索登录详细信息。



一些开发人员将登录详细信息存储在数据库中。
The option "Remember Me" is oftenly retain the login details in cookies.
Once the user access your website, you can retrieve the login details from cookies.

Some developers store the login details in database.


我试过以下代码:[ ^ ]

I tried the following code:[^]
Membership.GetUser(username, true);



成功设置使用r在线。



感谢所有


worked successfully to set user as on-line.

thanks to all


这篇关于在asp.net会员中将用户设置为在线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆