LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-26-2004, 07:17 AM   #1
zowey
Member
 
Registered: Feb 2004
Location: Croatia
Distribution: slackware 10.1, debian sarge, knoppix, ubuntu 7.04
Posts: 67

Rep: Reputation: 15
Question sessions in PHP


I declare one variable, in file1.php:
Code:
<?php
   session_start();
   $_SESSION["something"] = "somevalue";
?>
and make file2.php:
Code:
<?php
   session_start();
   echo $_SESSION["something"];
?>
when I execute file1, then file2 I get value of session, but
when I close my browser and start it again, executing the file2
without file1 I don't get value of session variable... why?
 
Old 12-26-2004, 07:25 AM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
Once you close your browser, the session is over and the server releases the session resources.
 
Old 12-26-2004, 07:35 PM   #3
zowey
Member
 
Registered: Feb 2004
Location: Croatia
Distribution: slackware 10.1, debian sarge, knoppix, ubuntu 7.04
Posts: 67

Original Poster
Rep: Reputation: 15
re::

I don't know what happened, now just I don't lose session variable when I close browser.. strange
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
php sessions problems MaestroC Suse/Novell 2 12-06-2005 09:06 AM
Troble on PHP Sessions Gerardoj Programming 4 05-25-2004 02:03 PM
Problem with php sessions sashhoney Linux - Software 7 08-28-2003 08:30 AM
Apache PHP and sessions Satriani Programming 0 04-21-2003 12:55 PM
PHP Sessions RecoilUK Programming 1 04-21-2002 06:57 AM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration