Reputation: 4389
I have a small app, that redirects on successful user sign in and also on app initialization it defines custom session handlers. Redirect is done this way: sprintf( '<html><head><meta http-equiv="refresh" content="%d;url=%s"/></head></html>', $delay, $url );
.
Now the question is. If I redirect this way, will it reach custom session handler during, that call?
Upvotes: 0
Views: 143
Reputation: 174977
You're doing it wrong. Use the header()
function to send a Location
header like so:
<?php header("Location: $url"); ?>
Add that before any output is sent. And yes, the session will remain.
Upvotes: 1
Reputation: 737
Not sure why you are redirecting that way.
session_start();
// do something
header("Location: some_url_to_redirect");
Upvotes: 0