如何在打开浏览器然后显示时获取会话数据 [英] how to get session data when open browser then show

查看:110
本文介绍了如何在打开浏览器然后显示时获取会话数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谷歌crome的例子,浏览器中的mozila会话数据存储然后broswer完全关闭会话被破坏,问题是当打开浏览器然后显示时如何获取会话数据?



helpp me

解决方案

简单:它没有存储在会话中 - 会话存储在服务器上,永远不会离开它。会话结束时会话数据丢失 - 这可能发生在浏览器(或浏览器显示的页面)关闭之前。



如果要关闭浏览器而且没有松散的数据,那么你有两个选择:

1)Cookies。它们存储在客户端上,可以由服务器访问。

2)数据库。如果您的用户必须登录您的站点,您可以根据其用户ID存储信息并从那里恢复。


example of google crome,mozila session data store in browser then broswer completely closed session is destroyed and problem is how to get session data when open browser then show ?

helpp me

解决方案

Simple: it's not stored in the Session - the Session is stored at the Server, and never leaves it. Session data is lost when the session closes - which can happen before the browser (or the page the browser is displaying) is closed.

If you want to close the browser and not loose data then you have two options:
1) Cookies. These are stored on the Client and can be accessed by the Server.
2) Database. If you user must log into your site, you can store information against his user ID and restore it form there.


这篇关于如何在打开浏览器然后显示时获取会话数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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