如果我们在没有注销的情况下关闭浏览器窗口,那么当我们在浏览器中提供相同的URL时会发生什么? [英] If we close browser window without getting logout, what will happen when we provide same URL in the browser?

查看:92
本文介绍了如果我们在没有注销的情况下关闭浏览器窗口,那么当我们在浏览器中提供相同的URL时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,



几天前,我出现在.net开发人员的软件公司的采访中。在那里我被问到一个问题

如果我们关闭浏览器窗口而没有注销,当我们在浏览器中提供相同的URL时会发生什么?

我的回答是用户将能够查看具有登录详细信息的主页,而不是在用户的会话尚未结束时提示用户名和密码。实际上将从cookie中检索登录信息。但这取决于我们为Login实现的逻辑。但面试官似乎对我的回答并不满意,也不接受我的回答。我想知道这个问题的答案可能是什么。所以,我需要你对正确答案的善意指导。所以请解释我应该回复的内容。





先谢谢。

解决方案

当然这个问题在某种程度上是不公平的 - 因为有两个答案,短期和长期。

短 - 你给的那个 - 并不是完全错误但缺少很多东西。 ..

长期是它依赖 - 从那里你可以进行20分钟的需求解释,设计和实施以及用户选择等等......

然而你可能会忘记'它是依赖'并指出没有最终解决方案,因此没有最终行为......


不,

如果我们关闭浏览器, Session 值将被清除。

所以如果他们试图在新的浏览器窗口中打开网址它将提示用于登录凭证。

注意:在浏览器选项卡中,会话值将普通



如果网站背后的逻辑 Cookies

Greetings,

Few days ago, I appeared in an interview in a software company for .net developer. There I was asked a questions that

If we close browser window without getting logout, what will happen when we provide same URL in the browser?

My answer was that user will be able to view the home page with login details instead of being prompted to provide username and password as session of the user has not ended. Login information will actually be retrieved from cookies. But it depends upon the logic we have implemented for Login. But interviewer doesn't seem be satisfied with my answer and didn't accept my answer. I am wondering what might be answer of this question. So, I need your kind guidance regarding correct answers. So please explain what I was supposed to reply.


Thanks in Advance.

解决方案

The question of course was somehow unfair - as there is two answers, short and long.
The short - the one you gave - is not exactly wrong but missing a lot of things...
The long is 'it's depend' - and from there you can go into a 20 minutes explanation of needs and design and implementation and user choice and on and on...
However you may got away with 'it's depend' and pointing out that there is no ultimate solution and so there is no ultimate behavior...


No,
If we close the browser, the Session values will be cleared.
so if they tried to open the url in a new browser window it will prompt for the Login credentials.
Note: Across the browser Tabs,the Session values will be Common.

Your answer will be right, if the logic behind the site is using Cookies


这篇关于如果我们在没有注销的情况下关闭浏览器窗口,那么当我们在浏览器中提供相同的URL时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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