Re: Store form values in session

From: Sjaakie Helderhorst (non.existant_at_email.com)
Date: 09/29/04


Date: Wed, 29 Sep 2004 11:16:59 +0200


"cool" <coo@goontrytospamme.dk> schreef in bericht
news:pan.2004.09.28.05.56.20.484805@goontrytospamme.dk...
>
>>> Maybe I'm using a wrong approach, can you put me in the right direction?
>>>
>>> Thanks in advance!
>>>
>>>
>
> Hi,
>
> I think you may be using a wrong approach. When a user clicks on the
> browser "back" button, I think a cached request of the previous page,
> including all values entered in the previous page's fields, are sent to
> the server. In this case, the $_POST of the previous page should contain
> the previous page's form field values, which may be what you want.
> However, I don't think this behavior is guaranteed, and maybe something
> that can be adjusted in the browser.
>
> You can check this by simply printing out the contents of the $_POST (or
> $_GET depending on your situation) arrays, put a print_r or whatever
> statement at the top of each of your scripts, and see what you get when
> you hit the back button. With several of these array dumps for $_SESSION
> and $_POST around your code, you can at least see what is or is not
> happening.
>
> I generally find that it is a bad idea to allow the user to use the back,
> forward or refresh button of the browser, in particular if the web pages
> are used to alter a database. So I place my own back, etc. buttons on my
> pages, and I penalize the user for attempting to use back, forward or
> refresh of the browser with a little bit of code that senses this, and
> sends the user back to the site's introduction page.
>
> Regards,
> Steve, Denmark

Printing $_SESSION content show me post data is not available in session
(maybe even removed) whenever I move back (custom button) to previous page.
Maybe storing these vars in a database could solve this issue, but there are
lots and lots of vars (depends on choices made by visitor)...



Relevant Pages

  • Re: global variables
    ... $_REQUESTis all the GET vars followed by all the POST ... No session starts until you issue the "start_session" command ... The script doesn't have any session data. ... PHP goes off and finds the saved variables for this browser (other ...
    (php.general)
  • Re: Forced user logout / Cancel sessions and cleanup
    ... release a session based upon a last response time ... without having to hear from the browser at all. ... Currently I am storing the 'last heard from' timestamp in a database ... if no one hit the page the database ...
    (comp.lang.php)
  • Re: User login
    ... sign in again on another machine or browser. ... That's easy - use a database. ... set a flag against their ... provide a Logout button which tears down the Session. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: browser differences, IE, FF, and Opera
    ... avoid messing around with the browsers history? ... their session key. ... but I was able to get back to the database. ... I'm looking at the database console in my browser. ...
    (comp.lang.javascript)
  • Re: Session_OnEnd doesnt get called when shutting down a browser
    ... > what my client wants is to keep users from sharing access to the site. ... I think there is a long-standing perception that database access is a boar. ... application array or the database after the session would have timed out. ... If they shut down their browser, then, ...
    (microsoft.public.inetserver.asp.general)