Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    32
    Thanks
    7
    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.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,495
    Thanks
    8
    Thanked 1,089 Times in 1,080 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:
    http://www.dustinsdesign.com/php-sessions-vs-cookies/

    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •