GetSimple Support Forum
Session Cookies not working after update to 3.2.2 - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Session Cookies not working after update to 3.2.2 (/showthread.php?tid=5060)



Session Cookies not working after update to 3.2.2 - retrofan - 2013-08-13

Hello,
first, thanks for your work and for the latest release.
All works fine, except for my Session Cookie JQuery Ajax Script.

I call the following script using a JQuery Ajax Post:
PHP Code:
<?php
    $result 
1;
    
session_start();
    if (
$_POST['command'] == 'togglesize' ){
        if (@(
$_SESSION['textsize'] == "normal") ){
            
$_SESSION['textsize'] = "big";
        } else {
            
$_SESSION['textsize'] = "normal";
        }
        
$result 0;
    }
  
/* some more... */
    
echo $result;
?>
The request works, but the SESSION cookie is not created and I have no access to the cookie later in my template.php. Did I overwrite some setting while performing the upgrade, oder is there something changed in session handling?

Greetings and thanks for hints!


RE: Session Cookies not working after update to 3.2.2 - shawn_a - 2013-08-13

Not that I know of. We do not even use sessions.

Turn debug on and look for errors.


RE: Session Cookies not working after update to 3.2.2 - retrofan - 2013-08-13

Got it.

I had to put a manual session_start(); call in the top of my template, which wasn't there yet. In earlier versions this was not necessary.
No problem, if you once know it Smile

Greetings


RE: Session Cookies not working after update to 3.2.2 - shawn_a - 2013-08-13

only thing i can think of is that something is now being output and breaking cookie sessions, could be whitespace somewhere, ill look if any files have whitespace after php closing tags.

Or you have a php error or something sending data before your old session start call.


RE: Session Cookies not working after update to 3.2.2 - retrofan - 2013-08-13

Thanks again for your fast reply!
(2013-08-13, 04:24:13)shawn_a Wrote: Or you have a php error or something sending data before your old session start call.

I made several tests using debug mode, but didn't find any php errors. Sessions work fine with an explicit "session_start();" command in the top of my templates. Without this, they won't work.
But I had no "old" session_start() call. Till yesterday there was no need to use one. Perhaps its cleaner coded now, or you had a session_start() call somewhere?


RE: Session Cookies not working after update to 3.2.2 - shawn_a - 2013-08-13

The code you pasted has it what do you mean?


RE: Session Cookies not working after update to 3.2.2 - retrofan - 2013-08-13

(2013-08-13, 22:26:45)shawn_a Wrote: The code you pasted has it what do you mean?
The code I posted is the script, which is called by the JQuery-Ajax call from my website. This one has a session_start() thats true.

But my template itself, in which I use the session-cookie for e.g. to get my actual text-size settings (in this example) had no session_start command until I did the upgrade yesterday and it worked anyway.

Sorry, for my english and probably difficult way of describing things...