I wonder if anyone can suggest an answer here:
We have a system which is secured using PHP sessions (and other measures such as SSL, before anyone starts talking security at me!) and we want to send out direct links into the system via email, when contacting clients about specific issues. The links we send out include GET parameters.
Our advice has been for the client to make sure they're logged in, then click the link - the link launches in the browser, picks up the session, and takes the user straight to the required page. However, this doesn't work when the user clicks the link from a Microsoft Office application.
When clicking the link from Outlook (or indeed, Excel) the session variable is not picked up, and the user is asked to re-authenticate. Digging a bit further, it appears as though the request is coming through with user-agent set to Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0E; .NET4.0C; ms-office)
but the site is launching in Chrome (which is also the browser where the session is set). I wonder if there's some session-security code kicking in, saying that if the browser is different, the session must be spoofed?
Trying to get around this, I tried setting up a redirect page for the initial page-load:
if (isset($_GET['targetpage'])) {
// It's a GET request - redirect using header-location
$all_get = $_GET;
unset($all_get['targetpage']);
$redir = $_GET['targetpage'].'?'.http_build_query($all_get);
header('User-Agent:');
header("Location: {$redir}");
die();
}
This fails: the request still comes through with the User-Agent set, and the session is absent.
Any thoughts/suggestions?