updating a session var from a host name
Posted: Thu Jan 20, 2005 9:45 am
Ok, here's the scenario:
I have some users that have session vars set. They then move to a different host on the same machine (secure.mydomain.com vs http://www.mydomain.com) so they can do some stuff in a secure environment. After they've done their stuff I need to send them back to the www host and I need to update one of the session vars that is set based on the stuff they've done in secure.mydom... One of the session vars is displayed on every page on the http://www.mydom...
I've thought of a few different options to handle this. One would be to query the db on every page to check if I need to reset my session var...but I want to avoid this if possible because of processor time. Another option I've thought of (which I'm currently doing) is to put a button on the secure.mydom... page that says "you must click here to update your account" which sends them to an intermediate page which queries the db and updates their session var (if necessary). This works great, but it's lame...very focking lame indeed.
another option I thought about and tried, to no avail was to check the referring url and if it is from secure.mydom... then do the query and update if necessary. The reason this didn't work is because the http_referer wasn't being set when they came from secure.mydom.... (is this because it's from an HTTPS://??? In any case, it didn't work.
The last option which has two parts was this. Part one: Just make all of the links on that page go to the intermediate page (with something like <a href="www.mydom..../intermediate.php?page=htt ... p">here</a> and then run my query from there (don't force them to click a button) This would be good except that I'd have to change over 200 links with all of my js dropdown menus (burrito = lazy = don't wanna do this). Part two: could I just set some kind of php var on that page that automatically sent them to the intermediate page and not have to manually hard code all of the links with the intermediate page in the links? In other words just set something at the top of page like: $link = http://www.mydom.../intermediate.php?page=; and then append the links to that (w/o hard coding them all in)?
Is there another way to handle session vars across hosts that I don't knwo about?
Can anyone thign of another solution that would work for me here?
thx in advance for your time.
Burr
I have some users that have session vars set. They then move to a different host on the same machine (secure.mydomain.com vs http://www.mydomain.com) so they can do some stuff in a secure environment. After they've done their stuff I need to send them back to the www host and I need to update one of the session vars that is set based on the stuff they've done in secure.mydom... One of the session vars is displayed on every page on the http://www.mydom...
I've thought of a few different options to handle this. One would be to query the db on every page to check if I need to reset my session var...but I want to avoid this if possible because of processor time. Another option I've thought of (which I'm currently doing) is to put a button on the secure.mydom... page that says "you must click here to update your account" which sends them to an intermediate page which queries the db and updates their session var (if necessary). This works great, but it's lame...very focking lame indeed.
another option I thought about and tried, to no avail was to check the referring url and if it is from secure.mydom... then do the query and update if necessary. The reason this didn't work is because the http_referer wasn't being set when they came from secure.mydom.... (is this because it's from an HTTPS://??? In any case, it didn't work.
The last option which has two parts was this. Part one: Just make all of the links on that page go to the intermediate page (with something like <a href="www.mydom..../intermediate.php?page=htt ... p">here</a> and then run my query from there (don't force them to click a button) This would be good except that I'd have to change over 200 links with all of my js dropdown menus (burrito = lazy = don't wanna do this). Part two: could I just set some kind of php var on that page that automatically sent them to the intermediate page and not have to manually hard code all of the links with the intermediate page in the links? In other words just set something at the top of page like: $link = http://www.mydom.../intermediate.php?page=; and then append the links to that (w/o hard coding them all in)?
Is there another way to handle session vars across hosts that I don't knwo about?
Can anyone thign of another solution that would work for me here?
thx in advance for your time.
Burr