ivan
11/10/2022, 5:07 PM// application.cfc
component {
if( cookie.keyExists("snapshot") && cookie.snapshot.len() ){
this.root = getDirectoryFromPath( getCurrentTemplatePath() );
this.mappings["/"] = this.root & "../" & cookie.snapshot;
}
// ...
}
Also, I don't know how to deal with static assets (css/js/images) because those mapped in the application.cfc are not calledzackster
11/10/2022, 5:10 PMivan
11/10/2022, 6:03 PMzackster
11/10/2022, 6:06 PMzackster
11/10/2022, 6:07 PMzackster
11/10/2022, 6:07 PMbdw429s
11/10/2022, 6:14 PM../../../windows/system32/
ivan
11/10/2022, 7:19 PMstatic assets is easy, just reference them all with a prefix from a session var.I don't think I understand. Can you give me an example? for example a CSS link inserted like this:
<link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet" type="text/css">
it will be managed by the web server (IIS/apache/nginx) and will always refer to the root directory of the webserver and NOT to the one I set in this.mappings["/"] = this.root & "../" & cookie.snapshot;
the biggest problem i see here is you are taking user provided paths into your appMine is just a simplified example to explain the problem. I will do all the security checks to improve the procedure.
ivan
11/11/2022, 5:31 PM