ajax session php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hey gaiz plz I want to cerate log in system in ajax i do it but i have
one problem

AFTER I start thes session then press refresh key the session gone !!!
in other words , after the user type hid username and password  I send
this information by XMLrequest to php file which verify the user name
and the password if trure open the sesstion and get it name 'user' its
become like this


actually after i open the sesstion_start();

BUT THE PROBLEM IS WHN I PRESS F5 "refresh the page  the sesssion is


alot of htanx in advance

Re: ajax session php

Quoted text here. Click to load it

So, you were in a hurry in typing, weren't you?
When using this kind of thing to login, first consider wether or not thi=
s  =

breaks your total page becomes useless without javascript. Create a nice=


Now, the way you use it, only cookies can be used to hold the session_id=
,  =

PHP is not there for you to rewrite GET or POST variables (or you have t=
o  =

do it with javscript... messy). I think it might be a security issue,  =

where the cookie received by a javascript call is not set/denied by the =

browser. Try to:
- check with javascript wether or not the cookie is set after your reque=
- print the session_id to screen
- check the headers that are sent on refresh

-- =

Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel

Re: ajax session php

Quoted text here. Click to load it

Make sure session_start() is at the top of every file.
Try setting the php ini setting to use cookies for sessions, and make
the session lifetime greater.
should work.

Re: ajax session php

On Mar 9, 1:19 pm, dschr...@gmail.com wrote:
Quoted text here. Click to load it

I assume it is not session but the page refresh in Ajax.
When you refresh a page in ajax all data is be lost.
For this you should use login without Ajax. After login you can use
Ajax for another things.
And remember at the first page also from where you are using ajax, use

Site Timeline