mscreolo / php-calendar

Automatically exported from code.google.com/p/php-calendar
0 stars 0 forks source link

can't login after install #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install
2. click login

What is the expected output? What do you see instead?
"Session has expired." displays

What version of the product are you using? On what operating system?
php-calendar-2.0-beta10

Please provide any additional information below.
tried on multiple browser but same results

Original issue reported on code.google.com by csdesi...@gmail.com on 23 Jul 2012 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
It seems like there's something funny with your sessions in PHP. What version 
of PHP are you using? Can you post your phpinfo? Or at least the session part 
of it? The next version will have persistent connection, so they'll be 
recreated if the session data has been removed by PHP. It's kind of a 
confounding problem.

Can you try editing setup.php and delete lines 229 - 235. It's the section that 
starts with "// Expire the session after 30 minutes", 20 lines from the end of 
the file.

Original comment by sproctor@gmail.com on 23 Jul 2012 at 10:31

GoogleCodeExporter commented 9 years ago
edited the setup.php but same result. here is the session info and PHP Version 
5.3.13.

Original comment by csdesi...@gmail.com on 23 Jul 2012 at 10:57

Attachments:

GoogleCodeExporter commented 9 years ago
okay, assuming sessions work fine elsewhere, there's nothing odd looking about 
that config to me.

It's looking pretty good to me that the problem is with the session name. Try 
removing line 128, session_name...

If that doesn't fix it, on the line after the session_start(); put 
"print_r($_SESSION);" and post the output from that here. Hopefully that 
doesn't break things too much that you can't still login.

Original comment by sproctor@gmail.com on 23 Jul 2012 at 11:36

GoogleCodeExporter commented 9 years ago
hi, removing line 128 didn't work. i inserted print_r and funny thing happens. 
first, on top of the page "Array ( )" is printed and it actually logs in and 
displays the admin menu "Add Event Search View Month Log out Settings Calendar 
Admin Admin" however when clicked on the admin function button, it displays 
"You do not have permission to do that: You must be logged in as an admin."

when clicked on the "Add Event Search View Month" these then it displays the 
page but with logged out menu "Add Event Search View date Log in"

thanks

Original comment by csdesi...@gmail.com on 23 Jul 2012 at 11:53

GoogleCodeExporter commented 9 years ago
A few more ideas. Add an echo before the session_start in setup.php on line 129 
(or now 128). That should print a 1, or 0 if something went wrong.

Doing a bit of research I found this:
--------
For the session problem when using header("Location:..."), I found 
session_write_close() not to help me on the my IIS server using PHP in CGI 
mode. The problem was the PHPSESSID cookie was never being set, so I did it the 
manual way:

header("Set-Cookie: PHPSESSID=" . session_id() . "; path=/");

Worked for me this way!
--------

Try putting header("Set-Cookie: PHPSESSID=" . session_id() . "; path=/");
after the session_start() in setup.php. I'm guessing you're not on IIS, but 
maybe that is still happening for some reason.

I haven't dealt with this stuff for a while. There's some more stuff in 
comments here: http://www.php.net/manual/en/function.session-write-close.php

Some people on stackoverflow think that session_start() needs to be on the 
first line of the script. This seems off to me and I've never done that before 
not had any problems. You could try deleting that line from setup.php and add 
it to the first line of index.php after the <?php

It's possible that your session directory isn't writable by PHP. that was 
/var/php_sessions, I think.

If you still can't get it working, I'll try searching around some more.

Original comment by sproctor@gmail.com on 24 Jul 2012 at 1:23

GoogleCodeExporter commented 9 years ago
nothing worked but the problem wasn't the code. i finally figured it out. the 
hosting company had the php_sessions folder permission blocked luckily they did 
provide to php.ini file so i was able to change the session save folder to 
somewhere else. thank you for your help. 

Original comment by csdesi...@gmail.com on 24 Jul 2012 at 3:23

GoogleCodeExporter commented 9 years ago
I'm glad you got it sorted out.

Original comment by sproctor@gmail.com on 24 Jul 2012 at 8:27