poleposters Posted April 15, 2008 Share Posted April 15, 2008 I've been having some problems with my sessions. They appear and vanish randomly as I refresh the browser.I've checked my code and it looks fine. Everything works without error on my localhost, except when I upload the scripts onto my web server the sessions behave strangely. I've checked out the faq on my webhost page and it tells me I need to save the session path to the directory /clientdata/clients/first-letter-of-your-domain/ second-letter-of-your-domain/your-domain/www/ Instead of /tmp They have suggested I insert this code. ini_set("session.save_handler", "files"); session_save_path ("path_to_temp_dir/"); However they haven't specified where I insert the code. Can anyone help? I've sent them an email but need to get this sorted as soon as possible.They'll probably take days. Link to comment https://forums.phpfreaks.com/topic/101217-solved-how-do-i-change-the-session-save-path/ Share on other sites More sharing options...
chronister Posted April 15, 2008 Share Posted April 15, 2008 Session Save Path is probably not going to help. Make sure that you have a session_start(); at the top of each page you want a session to be held on. That sounds more likely Nate Link to comment https://forums.phpfreaks.com/topic/101217-solved-how-do-i-change-the-session-save-path/#findComment-517723 Share on other sites More sharing options...
benphp Posted April 15, 2008 Share Posted April 15, 2008 My web host had me include the ini_set just after the session_start(). Try placing it just under your session_start. Link to comment https://forums.phpfreaks.com/topic/101217-solved-how-do-i-change-the-session-save-path/#findComment-517725 Share on other sites More sharing options...
poleposters Posted April 15, 2008 Author Share Posted April 15, 2008 Thank you for your replies, but I solved it. I tried every which combination. I had to place it before my session starts. Phew! I've been building this site for months and this would of been a nightmare if I couldn't get it to work. Link to comment https://forums.phpfreaks.com/topic/101217-solved-how-do-i-change-the-session-save-path/#findComment-517735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.