网站中的会话管理 [英] session management in websites

查看:74
本文介绍了网站中的会话管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有以下情况:

用户登录网站,浏览某些页面并保存数据在会话的每个页面中。有6页,上一页的数据是下一页数据的来源。

但是在登录超时的情况下,会话也将被清除。然后将要求用户再次登录。

假设用户在第5页或第6页。因此,如果他被重定向到该页面,页面的数据源将为空,因此会抛出错误。

有没有办法管理它?

一种方法是将用户导航到第一页。但除此之外,还有其他解决方案吗?

Hi,

I have the following situation:
The user logs in the website, navigates through certain pages and data is saved in every page in the session. There are 6 pages and data in the previous page is the source for data in the next page.
However in a scenario where the login times out, the session will also be cleared. Then the user will be asked to login again.
Suppose the user is in the 5th or 6th page. So if he is redirected to that page the data source for the page will be null and hence it will throw an error.
Is there any way of managing that?
One approach is navigating the user to the 1st page. But apart from this, is there any other solution?

推荐答案

我认为通过表单身份验证可以更好地处理将用户重定向到登录页面的最佳方法。请参阅此链接。



如何:实现简单表单身份验证 [ ^ ]



这里,如果用户试图打开某个页面,如果不允许,那么她将被要求提供证书。一旦提供,她将登陆她试图访问的页面。



使用会话有一些缺点,例如它将被存储在服务器上,所以它的主意很糟糕。



问候......:笑:
I think the best way to redirect the user to login page can be better handled by forms authentication. Refer to this link.

How to: Implement Simple Forms Authentication[^]

Here,if the user tries to open some page and if its not allowed,then she will be asked to provide credentials. Once provided the same,she will be landed to the page she was trying to access.

Using session have some disadvantages e.g. It will be stored on server,so its bad idea.

Regards..:laugh:


这篇关于网站中的会话管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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