在asp c中每次只保留一个用户登录# [英] To maintain only one login per user at a time in asp c#

查看:68
本文介绍了在asp c中每次只保留一个用户登录#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我参加了面试,他们的面试官问了我一个类似的问题,

如何只保留一次登录每个用户一次在asp dot net。



我回复说,在用户表中保留一个标志,用于登录并在注销应用程序时重置。 />


但是面试不接受这个答案。



你认为其他任何有效方式都有吗?对于这个要求。



提前谢谢答案。

Hi,

I have attended an interview, their the interviewer asked me a question like,
How to maintain only one login per user at a time in asp dot net.

I replied that to keep a flag in user table for their login and reset while they log out the application.

But the interview do not accepts this answer.

Do you people think that any other efficient way is there for this requirement.

Thanks in advance fro the answer.

推荐答案

面试官不接受回答?听起来你不想要那份工作。大多数情况下你都是正确的。



很难知道用户何时退出应用程序,除非他们专门点击退出链接,因为他们可以关闭他们的浏览器和你不会知道的。他们的计算机可能崩溃,你不会知道。他们可能会失去权力等等。因此,我唯一要澄清的答案是,如果他们已经在不同的会话中登录,则每次登录都要检查。您还想存储时间戳。



然而,它仍然很棘手。我不知道IE是否还有这个问题,但是当IE引入标签时,有时在不同的标签页面中打开我的应用程序的链接会启动一个新的会话,有时它不会。所以,它仍然是每个用户相同的登录,但可能会启动另一个会话。



对于我的银行,过去如果你没有点击退出但只是关闭浏览器,然后回来尝试登录,然后会话到期之前他们会显示一条消息,您至少需要等待15分钟,因为他们一次只允许登录一次,这看起来不止一个。



底线,这是网络,除非你有充分的理由这样做,不要一次限制用户一个会话。这是糟糕的形式。
The interviewer did not accept that answer? Sounds like you don't want that job. You are correct, mostly.

It's hard to know when a user "logs" out of the application unless they specifically click a Logout link because they could close their browser and you wouldn't know it. Their computer could crash and you wouldn't know it. They could lose power, etc, etc. So, the only thing I would clarify to your answer is to just check each time they login if they are already logged in under a different session. You'd want to store a timestamp as well.

However, it's still tricky. I don't know if IE still has this issue but when IE introduced tabs sometimes opening a link from my app in a different tab would kick off a new session and sometimes it wouldn't. So, it's still the same login per user but could potentially kick off another session.

With my bank, it used to be that if you did not click logout but just closed your browser and then came back to try and login before your session expired they displayed a message that you had to wait another 15 minutes at least since they only allowed 1 login at a time and this looked like more than one.

Bottom line, this is the web, unless you have a very good reason to do so, don't limit users to one session at a time. It's bad form.


这是我个人的意见,当然不是普遍的。



这次采访不要气馁。别忘了!



我坚持认为,80%的面试只是表演,而你的面试官对他的问题的了解程度不高!



尝试下一次采访并虚张声势。用实际的口号/流行语淹没面试官。但是不要过分夸大它......以防万一你得到这份工作。



表现出自信和虚张声势!



你下一次采访的最佳状态!

问候,布鲁诺





不要给对方留下太多印象(面试官)。此外,他/她只会尝试以最好的方式出售他,并且看起来非常专业。并非所有闪闪发光的东西都是黄金;)

[/ EDIT]
This is my personal opinion and it is certainly not universal.

Do not be discourage by this interview. Simply forget it!

I maintain that 80% of the interviews are just show and your interviewer does not know half so much about how his questions!

Take an attempt at a next interview and bluff a little bit. Flood the interviewer with actual slogans/buzzwords. But do not overdo it all too much .... just in case you then get the job.

Show self-confidence and a bluff a little bit!

All the best for your next interview!
Regards, Bruno


Don't be impressed too much from your counterpart (interviewer). Also he/she tries only to sell him at the best and to appear as a very professional. Not everything that glitters is gold ;)
[/EDIT]


这篇关于在asp c中每次只保留一个用户登录#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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