Welcome! Log In Create A New Profile

Advanced

Using an SSI approach with set-cookie

October 07, 2017 01:56AM
I'm building a small set of configuration web pages in html/css with use of virtual SSI to make FastCGI passes to our c++ application. It works great for adding dynamic content from the code, but since my fastcgi pass occurs after the response header, I can't use set-cookie this way. Now I could move all HTML code into my app, but I'd rather not do this as I like to edit it and test things in a browser with just the HTML file.

I came up with a strategy to allow use of cookies as follows:
1) Use a location {} block #1 in nginx config to fastcgi pass everything to my app
2) location {} block #2 will check for (.html/.css/.jpg/etc) pages and grab them from disk instead.

Using this method, I'm able to use set-cookie, and then do a 301 redirect to an HTML file (which in turn includes the virtual SSI to call me back for dynamic content). i.e. All of my <a href> in the html will point at pages with no extension "/homepage". Once I field the script request, i can set-cookie then redirect to "/homepage.html".

Seems to be working great so far. But I wonder about how compatible this approach may be per browser?
Subject Author Posted

Using an SSI approach with set-cookie

skidaddytn October 07, 2017 01:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready