LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 06: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, 06: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, 06: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



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 / openSUSE 2 12-06-2005 08:06 AM
Troble on PHP Sessions Gerardoj Programming 4 05-25-2004 01:03 PM
Problem with php sessions sashhoney Linux - Software 7 08-28-2003 07:30 AM
Apache PHP and sessions Satriani Programming 0 04-21-2003 11:55 AM
PHP Sessions RecoilUK Programming 1 04-21-2002 05:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:27 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration