How to access data stored in dcc.Store (browser memory) from flask rest api (request)

Hi I’m trying to use retrieve the data stored in dcc.Store from a flask api and then use it to edit a local file.

But I’m unable to retrieve the stored data using flask. Any help is appreciated.

Here I have made a 2 page dash app and give the 2nd page a pathname after some processing (here clicking buttons), based on this pathname (/check) I want my flask app to retrieve the data.

from flask import Flask

make a 2 page app
on the 2nd page submit button should generate a link
on that page there should be dcc.Store
create a flask api to retrieve that data 

from flask import Flask, request, json, jsonify

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State

server = Flask(__name__)

external_stylesheets = ['']

app = dash.Dash(__name__, server = server, external_stylesheets=external_stylesheets)
app.config['suppress_callback_exceptions'] = True

page_1_layout = html.Div([
    html.Div("Hi this is Page 1"),
    html.Button(id = 'submit-button',children='Submit')

page_2_layout = html.Div([
    html.Div("Hi this is Page 2"),

app.layout = html.Div([

def check_data():
    if request.method=='POST':
        data = json.loads(
        return jsonify(data)

def test1(n_clicks):
    if n_clicks:
        return page_2_layout
    raise dash.exceptions.PreventUpdate

def test2(n_clicks):
    if n_clicks:
        msg = 'yes or no'
        return msg,True
    raise dash.exceptions.PreventUpdate

def test3(snc):
    if snc:
        path = ['/check']
        return path
    raise dash.exceptions.PreventUpdate

if __name__=='__main__':
    app.run_server(debug=True, threaded=True)