FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Lost $_SESSION in Google Chrome
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Lost $_SESSION in Google Chrome [message #178589] Tue, 10 July 2012 05:02 Go to next message
Falk Fiedler is currently offline  Falk Fiedler
Messages: 3
Registered: August 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
hello,

my local Google Chrome loses session on every page request. I tested with:


<?php

session_start();

echo session_id()."<br>";

if(!isset($_SESSION['temp']))
{
$_SESSION['temp']=99;
}
else
{
$_SESSION['temp']--;
}

echo $_SESSION['temp'];

?>

the session_id() is new on every page request and the $_SESSION['temp' is always 99.

But only on my local webserver. The script works on a webspace. What's wrong with the local config of Chrome?

Thank you


Falk
Re: Lost $_SESSION in Google Chrome [message #178591 is a reply to message #178589] Tue, 10 July 2012 05:16 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 7/10/2012 5:02 AM, falk(dot)fiedler(at)googlemail(dot)com wrote:
> hello,
>
> my local Google Chrome loses session on every page request. I tested with:
>
>
> <?php
>
> session_start();
>
> echo session_id()."<br>";
>
> if(!isset($_SESSION['temp']))
> {
> $_SESSION['temp']=99;
> }
> else
> {
> $_SESSION['temp']--;
> }
>
> echo $_SESSION['temp'];
>
> ?>
>
> the session_id() is new on every page request and the $_SESSION['temp' is always 99.
>
> But only on my local webserver. The script works on a webspace. What's wrong with the local config of Chrome?
>
> Thank you
>
>
> Falk
>

This is a PHP newsgroup. If you want to know what's wrong with Chrome,
I suggest you ask Chrome support.

Does it work with Firefox and/or IE? If so, then it's almost definitely
not a PHP problem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: Lost $_SESSION in Google Chrome [message #178592 is a reply to message #178591] Tue, 10 July 2012 05:21 Go to previous messageGo to next message
Falk Fiedler is currently offline  Falk Fiedler
Messages: 3
Registered: August 2011
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
> This is a PHP newsgroup. If you want to know what&#39;s wrong with Chrome,
> I suggest you ask Chrome support.
>
> Does it work with Firefox and/or IE? If so, then it&#39;s almost definitely
> not a PHP problem.
>
> --
> ==================

yes, it works in FF or IE - but I thought maybe someone knows the problem.

Falk
Re: Lost $_SESSION in Google Chrome [message #178593 is a reply to message #178592] Tue, 10 July 2012 05:56 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 7/10/2012 5:21 AM, falk(dot)fiedler(at)googlemail(dot)com wrote:
>> This is a PHP newsgroup. If you want to know what&#39;s wrong with Chrome,
>> I suggest you ask Chrome support.
>>
>> Does it work with Firefox and/or IE? If so, then it&#39;s almost definitely
>> not a PHP problem.
>>
>> --
>> ==================
>
> yes, it works in FF or IE - but I thought maybe someone knows the problem.
>
> Falk
>

Ask in the proper place and you will have a much better chance of
getting an accurate answer. Ask in the wrong place and you will more
likely get crap answers from someone who has no idea what he's talking
about.

This seems to be especially true for off-topic questions in this newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: Lost $_SESSION in Google Chrome [message #178601 is a reply to message #178589] Tue, 10 July 2012 14:52 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
falk(dot)fiedler(at)googlemail(dot)com, 10.07.2012 11:02:

> hello,
>
> my local Google Chrome loses session on every page request. I tested with:
>
>
> <?php
>
> session_start();
>
> echo session_id()."<br>";
>
> if(!isset($_SESSION['temp']))
> {
> $_SESSION['temp']=99;
> }
> else
> {
> $_SESSION['temp']--;
> }
>
> echo $_SESSION['temp'];
>
> ?>
>
> the session_id() is new on every page request and the $_SESSION['temp' is always 99.

Works for me - no problem here with my local Apache.

Tested with Google Chrome 20.0.1132.47 m on Windows 7 Pro x64.

> But only on my local webserver. The script works on a webspace. What's wrong with the local config of Chrome?

What's wrong with your local webserver?


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: Lost $_SESSION in Google Chrome [message #178603 is a reply to message #178589] Wed, 11 July 2012 09:44 Go to previous messageGo to next message
Silver Moonstone is currently offline  Silver Moonstone
Messages: 1
Registered: July 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
> hello,
>
> my local Google Chrome loses session on every page request. I tested with:
>
>
> &lt;?php
>
> session_start();
>
> echo session_id().&quot;&lt;br&gt;&quot;;
>
> if(!isset($_SESSION[&#39;temp&#39;]))
> {
> $_SESSION[&#39;temp&#39;]=99;
> }
> else
> {
> $_SESSION[&#39;temp&#39;]--;
> }
>
> echo $_SESSION[&#39;temp&#39;];
>
> ?&gt;
>
> the session_id() is new on every page request and the $_SESSION[&#39;temp&#39; is always 99.
>
> But only on my local webserver. The script works on a webspace. What&#39;s wrong with the local config of Chrome?
>
> Thank you
>
>
> Falk

try clearing the browser cache.
it sometimes happens because chrome fetches the page from the cache.
Re: Lost $_SESSION in Google Chrome [message #178605 is a reply to message #178603] Wed, 11 July 2012 10:39 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 7/11/2012 3:44 PM, Silver Moonstone wrote:
> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>> hello,
>>
>> my local Google Chrome loses session on every page request. I tested with:
>>
>>
>> &lt;?php
>>
>> session_start();
>>
>> echo session_id().&quot;&lt;br&gt;&quot;;
>>
>> if(!isset($_SESSION[&#39;temp&#39;]))
>> {
>> $_SESSION[&#39;temp&#39;]=99;
>> }
>> else
>> {
>> $_SESSION[&#39;temp&#39;]--;
>> }
>>
>> echo $_SESSION[&#39;temp&#39;];
>>
>> ?&gt;
>>
>> the session_id() is new on every page request and the $_SESSION[&#39;temp&#39; is always 99.
>>
>> But only on my local webserver. The script works on a webspace. What&#39;s wrong with the local config of Chrome?
>>
>> Thank you
>>
>>
>> Falk
>
> try clearing the browser cache.
> it sometimes happens because chrome fetches the page from the cache.
>

That may be true, but it is a poor solution since you cannot expect your
visitors to do the same in order to use the site.

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: Lost $_SESSION in Google Chrome [message #178607 is a reply to message #178605] Wed, 11 July 2012 13:36 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Erwin Moller, 11.07.2012 16:39:

> On 7/11/2012 3:44 PM, Silver Moonstone wrote:
>> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>>> hello,
>>>
>>> my local Google Chrome loses session on every page request. I tested
>>> with:
>>>

[Session seems not to work with local webserver]

>> try clearing the browser cache.
>> it sometimes happens because chrome fetches the page from the cache.
>>
>
> That may be true, but it is a poor solution since you cannot expect your
> visitors to do the same in order to use the site.

But you could ensure, that caching will not happen at all by sending the
appropriate headers.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: Lost $_SESSION in Google Chrome [message #178608 is a reply to message #178607] Wed, 11 July 2012 17:33 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On Wed, 11 Jul 2012 19:36:57 +0200, Arno Welzel wrote:
> Erwin Moller, 11.07.2012 16:39:
>
>> On 7/11/2012 3:44 PM, Silver Moonstone wrote:
>>> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>>>> hello,
>>>>
>>>> my local Google Chrome loses session on every page request. I tested
>>>> with:
>>>>
>
> [Session seems not to work with local webserver]
>
>>> try clearing the browser cache.
>>> it sometimes happens because chrome fetches the page from the cache.
>>>
>>
>> That may be true, but it is a poor solution since you cannot expect your
>> visitors to do the same in order to use the site.
>
> But you could ensure, that caching will not happen at all by sending the
> appropriate headers.

and by "ensure", you actually mean "suggest".

--
"To every complex problem there is a solution which is
simple, neat and wrong" - HL Mencken
Re: Lost $_SESSION in Google Chrome [message #178617 is a reply to message #178607] Thu, 12 July 2012 00:00 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 7/11/2012 1:36 PM, Arno Welzel wrote:
> Erwin Moller, 11.07.2012 16:39:
>
>> On 7/11/2012 3:44 PM, Silver Moonstone wrote:
>>> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>>>> hello,
>>>>
>>>> my local Google Chrome loses session on every page request. I tested
>>>> with:
>>>>
>
> [Session seems not to work with local webserver]
>
>>> try clearing the browser cache.
>>> it sometimes happens because chrome fetches the page from the cache.
>>>
>>
>> That may be true, but it is a poor solution since you cannot expect your
>> visitors to do the same in order to use the site.
>
> But you could ensure, that caching will not happen at all by sending the
> appropriate headers.
>
>

Incorrect. Information sent in the headers is a suggestion, not a
requirement. Browsers are free to ignore things like cache control (and
almost anything else).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: Lost $_SESSION in Google Chrome [message #178621 is a reply to message #178608] Fri, 13 July 2012 04:57 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Am 11.07.2012 23:33, schrieb Peter H. Coffin:

> On Wed, 11 Jul 2012 19:36:57 +0200, Arno Welzel wrote:
>> Erwin Moller, 11.07.2012 16:39:
>>
>>> On 7/11/2012 3:44 PM, Silver Moonstone wrote:
>>>> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>>>> > hello,
>>>> >
>>>> > my local Google Chrome loses session on every page request. I tested
>>>> > with:
>>>> >
>>
>> [Session seems not to work with local webserver]
>>
>>>> try clearing the browser cache.
>>>> it sometimes happens because chrome fetches the page from the cache.
>>>>
>>>
>>> That may be true, but it is a poor solution since you cannot expect your
>>> visitors to do the same in order to use the site.
>>
>> But you could ensure, that caching will not happen at all by sending the
>> appropriate headers.
>
> and by "ensure", you actually mean "suggest".

Well... yes, when you assume that certain browsers or proxies ignore
caching related headers.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: Lost $_SESSION in Google Chrome [message #178622 is a reply to message #178617] Fri, 13 July 2012 04:58 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Am 12.07.2012 06:00, schrieb Jerry Stuckle:
> On 7/11/2012 1:36 PM, Arno Welzel wrote:
>> Erwin Moller, 11.07.2012 16:39:
>>
>>> On 7/11/2012 3:44 PM, Silver Moonstone wrote:
>>>> On Tuesday, July 10, 2012 2:32:28 PM UTC+5:30, (unknown) wrote:
>>>> > hello,
>>>> >
>>>> > my local Google Chrome loses session on every page request. I tested
>>>> > with:
>>>> >
>>
>> [Session seems not to work with local webserver]
>>
>>>> try clearing the browser cache.
>>>> it sometimes happens because chrome fetches the page from the cache.
>>>>
>>>
>>> That may be true, but it is a poor solution since you cannot expect your
>>> visitors to do the same in order to use the site.
>>
>> But you could ensure, that caching will not happen at all by sending the
>> appropriate headers.
>>
>>
>
> Incorrect. Information sent in the headers is a suggestion, not a
> requirement. Browsers are free to ignore things like cache control (and
> almost anything else).

Yes, you're right. But at least the chance that caching will not happen
is much higher when sending the appriopriate headers.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: Lost $_SESSION in Google Chrome [message #178623 is a reply to message #178589] Fri, 13 July 2012 05:27 Go to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 10/07/12 11:02, falk(dot)fiedler(at)googlemail(dot)com wrote:

> my local Google Chrome loses session on every page request. I tested with:
>
> the session_id() is new on every page request and the $_SESSION['temp' is always 99.
>
> But only on my local webserver. The script works on a webspace. What's wrong with the local config of Chrome?

Check your cookie permissions for your local site in chrome, most likely
you have a deny cookies in your Chrome.

If it had been a code issue, then you had the same result, no matter
which browser you tried.


--

//Aho
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: not understanding pattern matching
Next Topic: Stuck on Exercise 1
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Oct 24 03:42:11 EDT 2017

Total time taken to generate the page: 0.00878 seconds