session-storage

HTML5 session storage send to server

社会主义新天地 提交于 2019-12-10 08:11:27
问题 If I'm right, Session Storage is stored client side and is accessible only for one tab. How can I send information stored in the session storage to the server ? I can use cookie for that, but if I open 2 tabs, the cookie will be rewrite by the second tab. Thanks 回答1: The Storage object (both localStorage and sessionStorage) is available from all tabs having the same page open. However (some comment state this is not correct, but this is a misinterpretation of the documentation), when you open

HTML5 sessionStorage or chrome.storage for Chrome Extension?

余生颓废 提交于 2019-12-08 08:01:39
问题 I have a Chrome Extension that is only a content script. I want to persist some data that is calculated in the content script so I can easily access it while browsing without having to recalculate it on each page. I only need the data to be stored for the session. I was looking at the chrome.storage API but it seems data will persist there past the session. I have previous experience using HTML5 sessionStorage, but I feel like I should be leveraging Google's API here. Any input is appreciated

Test sessionStorage with Selenium Webdriver

[亡魂溺海] 提交于 2019-12-08 03:57:59
问题 I'm writing Java based selenium-webdriver tests. The app that I'm testing sets certain values in storageSession e.g. sessionStorage.setItem("demo", "test") , how can I check and assert the value of the stored variable demo inside my test 回答1: Found a great utility class https://gist.github.com/roydekleijn/5073579 import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; public class LocalStorage { private JavascriptExecutor js; public LocalStorage(WebDriver

Mocking sessionStorage when using jestjs

℡╲_俬逩灬. 提交于 2019-12-07 03:13:08
问题 Ok, so I have this simple example React component that interacts with sessionStorage: //App.jsx var React = require('react/addons'); var App = React.createClass({ handleSubmit: function (e) { }, handleNameChange: function (e) { sessionStorage.setItem('name', e.target.value); }, render: function () { return ( <form> <input type='text' label='Name' onChange={this.handleNameChange}/> <button type='submit' label='Submit' onClick={this.handleSubmit}/> </form> ); } }); module.exports = App; I've

Does HTML5 web storage (localStorage) offer a security advantage over cookies?

大憨熊 提交于 2019-12-07 01:01:11
问题 This question was migrated from Information Security Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . I was looking up alternative to cookies and I've read about HTML5 web storage here, and I've read a simpler explanation here but I still don't get how it works fully. Can someone offer a slightly non-techinical explanation so that I can then understand the technical bits. It says about browsers having to store key value pairs but where and how is it stored

Test sessionStorage with Selenium Webdriver

喜你入骨 提交于 2019-12-06 09:30:56
I'm writing Java based selenium-webdriver tests. The app that I'm testing sets certain values in storageSession e.g. sessionStorage.setItem("demo", "test") , how can I check and assert the value of the stored variable demo inside my test Found a great utility class https://gist.github.com/roydekleijn/5073579 import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; public class LocalStorage { private JavascriptExecutor js; public LocalStorage(WebDriver webDriver) { this.js = (JavascriptExecutor) webDriver; } public void removeItemFromLocalStorage(String item) { js

HTML5 session storage send to server

梦想与她 提交于 2019-12-05 13:09:04
If I'm right, Session Storage is stored client side and is accessible only for one tab. How can I send information stored in the session storage to the server ? I can use cookie for that, but if I open 2 tabs, the cookie will be rewrite by the second tab. Thanks The Storage object (both localStorage and sessionStorage) is available from all tabs having the same page open. However (some comment state this is not correct, but this is a misinterpretation of the documentation), when you open a new tab a new storage object is created internally. This is a clone of the first one so the content at

Where does Firefox store the sessionStorage content

大憨熊 提交于 2019-12-05 11:07:09
I am trying to find out where Firefox stores the sessionStorage content but have been unable to find so. I am expecting it to be in a SqLite database like the localStorage content is stored but I have not been able to find it. So far, I have searched all the typical ".sqlite" files in the profile folder such as cookies.sqlite and content-prefs.sqlite etc but they do not seem to have the sessionStorage data. I also tried to open the special in-memory database that Firefox supposedly creates - https://developer.mozilla.org/en/XPCOM_Interface_Reference/mozIStorageService#openSpecialDatabase%28%29

Save user object in Session Storage

落爺英雄遲暮 提交于 2019-12-05 03:02:08
I am using Angular 2 and Typescript and wanted to save the user object like a global variable so it hasn't to be retrieved multiple times. I found the session storage and now save the user object there. Do you think it is good practice to store it there or is the data too sensitve? If so, what other kind of cache could I use? Here is the code I use right now: user.service.ts: getProfile() { let cached: any; if (cached = sessionStorage.getItem(this._baseUrl)) { return Observable.of(JSON.parse(cached)); } else { return this.http.get(this._baseUrl).map((response: Response) => { sessionStorage

Prevent session creation on rails 3.2.2 for RESTful api

时光怂恿深爱的人放手 提交于 2019-12-04 17:31:37
问题 How can i prevent the session store from creating a session on JSON/XML calls ? My problem is that i save sessions in a database and it gets flooded on multiple api calls. I'm using Rails 3.2.2 and Devise for authentication. 回答1: My problem here was with Warden inside Devise. I had to "tell" Warden not to store the user in the session after the user is authenticated. resource = warden.authenticate!(:scope => resource_name, :store => !(request.format.xml? || request.format.json?)) Hope that