Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Set POST data manually in php?
07-20-2008, 05:05 PM #1
- Join Date
- Mar 2008
- Thanked 0 Times in 0 Posts
Set POST data manually in php?
Sorry if this has been covered (seems it must have been, but I can't find anything that helps me figure this out after 2 days of searching).
I want to use $_POST to send session IDs for users that don't have cookies. But I want to figure out if they have cookies first. So my plan is to detect if they are a new visitor, and if so, set a cookie & the POST data (SID), then refresh & check for the cookie, if there is no cookie, then their session can be passed from page to page by using links which use a form with invisible fields. I think I have most of it figured out, but I can't figure out how to send the initial POST data (on the refresh).
One thing I have read in a few blogs and forums is using a temporary redirect using header(), but I think I also read something a while back about how this can cause problems with search engines. Also, none of the people who mentioned using the header() redirect really said how to attach the POST data to the redirect url.
So, is there a way to manually send POST data when refreshing the page?
Thanks in advance for any help with this.
07-20-2008, 08:29 PM #2
- Join Date
- Jun 2003
- Cottage Grove, Minnesota
- Thanked 1,090 Times in 1,081 Posts
Don't even worry about the cookies ...
When someone visits a page, require another
file that sets the session. If you can't read the
session, then they are not allowing cookies.
Here is an explanation:
That explanation uses $_GET instead of $_POST. I don't
think you can use $_POST outside of a form. In any event,
you are only sending the Session ID using $_GET because
their cookies are disabled.
I can't imagine how anyone who disables cookies can even
stand to use the internet ... it has to be frustrating to browse
without cookies enabled, let alone using any website that uses
a login. If it were me, I would simply not worry about it. If
someone disables their cookies, they must not be too concerned
about using my website.