php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #11618 session and form data
Submitted: 2001-06-22 12:46 UTC Modified: 2002-08-13 23:13 UTC
From: guo_feng at sina dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.4 OS: linux 2.2.16-22
Private report: No CVE-ID: None
 [2001-06-22 12:46 UTC] guo_feng at sina dot com
<?
//test1.php
session_start();
$aaa="sfsdsdasdf";
$bbb="safsadfasdf";
session_register("aaa");
session_register("bbb");
?>
FORM METHOD=POST ACTION="test2.php">
<INPUT TYPE="text" NAME="a1">
<INPUT TYPE="text" NAME="a2">
<INPUT TYPE="submit">
</FORM>

?>
/---------------------------------------
<?
//test2.php
session_start();
echo "aaa:".$aaa."<br>";
echo "bbb:".$bbb
?>
<a href="javascript:window.history.back()">back</a>
/---------------------------------------

When I set the session_cache_limiter = nocache ,that I submit my form ,and I can get the correct session.
But when I click then back link ,I lost the data in the form .
So I change the session_cache_limiter = private or public. That when I back I can got the data in the form. And I have a new problem,I need check the session in my program when the different user login(I check use status using session ) ,
When I login use different user ,the session I got is not correct. And I found I can't destroy the session.What shall I do?

What is the different about nocache,private,public?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 12:57 UTC] guo_feng at sina dot com
I have solve the problem when I set session.cache_limiter  =must-revalidate
But I don't why!Can somebody tell me?
 [2001-06-23 06:35 UTC] sniper@php.net
reclassified as documentation problem.
This should be explained better in the manual.

 [2002-02-07 19:33 UTC] alindeman@php.net
Wasn't "nocache" a HTTP/1.0 thing?  Is "must-revalidate" the HTTP/1.1 equivilant?  Can anybody verify this 
so that I can do something with the docs.

 [2002-02-07 22:41 UTC] shiflett@php.net
To answer the most recent question from alindeman (I apologize, but I do not know your name):

The mention of nocache isn't exactly just HTTP/1.0, however the Pragma header in fact is unique to HTTP/1.0 and was only included in HTTP/1.1 to maintain backwards compatibility. No directives exist for this header except nocache.

HTTP/1.1 introduces the Cache-Control header, and with it comes many available directives. In fact, nocache is still one of these. I'm honestly not sure how the session_cache_limiter is implemented at the protocol level, but I can try to figure it out if it would be helpful to you.

guo_feng:

Though from your brief account I would say that you have now chosen the most appropriate value for session_cache_limiter (assuming it affects the value of the Cache-Control header), I would suggest learning more about it so that you feel more confident in your implementation. To briefly answer your question, however, public basically declares that the content may be cached by anything. Private has a bit more unclear definition to me (you might find more clarification in your research), but it basically allows caching but not in a shared cache. An example of a shared cache would be a proxy that many people are connected to, so the content might be considered a bit too sensitive to be accidentally returned to another user.

Hope that helps. Thanks for all your help guo_feng.

Chris
 [2002-02-08 08:33 UTC] alindeman@php.net
Ok. Try telnetting to that page "telnet yoursite.com 80"  Type:

HEAD /thepage.php HTTP/1.1
Host: yoursite.com

Obviously replace thepage.php and yoursite.com with your actual site.  See what the headers are (especially the "Pragma:" or "Cache-Control" headers)
 [2002-08-13 23:13 UTC] iliaa@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

The manual now contains clear exmaples of headers that should be sent to prevent caching of both HTTP/1.0 and HTTP/1.1 connections.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC