2 |
aperonnet |
1 |
This session scope state provider is in use in window/layout.html.
|
|
|
2 |
|
|
|
3 |
Usage:
|
|
|
4 |
|
|
|
5 |
get-state.php is included as JS file in the header of any page that needs state information. For a single
|
|
|
6 |
page application, that would be the main page of the application. It is NOT loaded via XHR/Ajax.
|
|
|
7 |
|
|
|
8 |
save-state.php is included in every page of the application, including pages loaded via ajax.
|
|
|
9 |
|
|
|
10 |
Inilialization of the SessionProvider looks like:
|
|
|
11 |
Ext.state.Manager.setProvider(new Ext.state.SessionProvider({state: Ext.appState}));
|
|
|
12 |
|
|
|
13 |
The way the session provider works is when a state change occurs, a cookie is set on the client
|
|
|
14 |
with the new state data. The next time any page is requested on the server, save-state.php
|
|
|
15 |
will see that cookie, save it in the application state and CLEAR THE COOKIE. This way your application
|
|
|
16 |
doesn't have cookies creating unneccessary network latency.
|