Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #46  
Old December 16th, 2001, 01:16 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:

Reply With Quote
  #47  
Old January 26th, 2002, 05:38 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Sessions with mulitple pages

That's the beauty of sessions. The customers browser keeps track of the session for you.(sort-of)
All you have to do is put session_start on each page and then use your variables. Each customer(browser) will have their own session and variables.

To see this in action, just create some sample session pages. Use session_id() to print out the id #'s.
Now, open the page up in two different browsers on your machine. Both have different session id's, but the id stays the same until you close the browser(or it times out)
Brian

Reply With Quote
  #48  
Old January 26th, 2002, 05:41 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Problem with the time elapse example

Well, not sure if it's a problem, or I just don't understand.

My question/problem: When refreshing the browser, it resets the session. I get a new session id and the script doesn't ever tell the time.
I put a link on the page to itself, click on that, and it works as intended(doesn't reset the session)
Is this how it's supposed to work? Or is there some setting in the configuration that changes how this works?
thx
Brian

Reply With Quote
  #49  
Old May 17th, 2002, 12:40 PM
Rich Lyon Rich Lyon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Aberdeen, UK
Posts: 1 Rich Lyon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Cannot send session cache limiter

Adam - this http://www.faqts.com/knowledge_base/view.phtml/aid/13713/fid/51

worked for me - I went to the enf of the file, hit backspace until I reached the > and the problem ... ermmm ..went away.

Reply With Quote
  #50  
Old September 15th, 2002, 10:18 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: cookie

Which might be said plainer, too.

If you have initialized a session using 'session_start()' you also can use 'session_id()'.::

<?php
// start the session
session_start();
echo "<a href=\"nextpage.php?PHPSESSID=" . session_id() . "\">Click for next page</a>";
?>


There is an important security breach to consider: even if you carefully do not add the session id to external links, the session id will be visible in the referer.

Reply With Quote
  #51  
Old September 15th, 2002, 10:28 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: cookie

Okay, sorry, that sucked. The "structured text" is obviously *not* implemented completely here...

The example from above which was gorked was (replace [] with < or >):

[?php

// open session

session_start();

// create GET session id variable

$mysessionid = "PHPSESSID=" . session_id();

// give an example of use

echo "[a href=\"nextpage.php?" . $mysessionid . "\"]Click for next page[/a]"

?]

Reply With Quote
  #52  
Old October 15th, 2002, 08:25 PM
jnk jnk is offline
php n00b
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 10 jnk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
problem with first code

the first cde on the tutorials doesnt work.

<?php

// initialize a session

session_start();

// register a session variable

session_register('counter');

// increment and display the value of the counter

$counter++;

echo("You have visited this page $counter times! Don't you have anything else to do, you bum?!");

?>

i get this error :

Notice: Undefined variable: counter in c:\program files\apache group\apache\htdocs\counter.php on line 10
You have visited this page 1 times! Don't you have anything else to do, you bum?!

and the counter doesnt go beyond 1.

Reply With Quote
  #53  
Old October 23rd, 2002, 03:20 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Cannot send session cache limiter

Give U two Exmaple!One is right,other is error!

This is an error
****************************
<html>
<head><title>this is a error exm!</title>
</head>
<body>
<?php
session_start();
session_register("test")
........................
?>
</body></html>
*************************************

this right
======================================
<?php
session_start();
session_register("test")
........................
?>
<html>
<head><title>this is a error exm!</title>
</head>
<body>
<?php
.................
?>
</body></html>
========================================

understand?Please email to me,if U want!

Reply With Quote
  #54  
Old October 23rd, 2002, 03:22 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Cannot send session cache limiter

Give U two Exmaple!One is right,other is error!

This is an error
****************************
<pre>
<html>
<head><title>this is a error exm!</title>
</head>
<body>
<?php
session_start();
session_register("test")
........................
?>
</body></html></pre>
*************************************

this right
======================================
<pre>
<?php
session_start();
session_register("test")
........................
?>
<html>
<head><title>this is a error exm!</title>
</head>
<body>
<?php
.................
?>
</body></html></pre>
========================================

understand?Please email to me,if U want!

Reply With Quote
  #55  
Old October 23rd, 2002, 03:26 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Cannot send session cache limiter

Give U two Exmaple!One is right,other is error!
<p>This is an error <br>
****************************<br>
<pre><br>
<html><br>
<head><title>this is a error exm!</title><br>
</head><br>
<body><br>
<?php<br>
session_start();<br>
session_register("test")<br>
........................<br>
?><br>
</body></html></pre><br>
*************************************</p>
<p>this right<br>
======================================<br>
<pre><br>
<?php<br>
session_start();<br>
session_register("test")<br>
........................<br>
?><br>
<html><br>
<head><title>this is a error exm!</title><br>
</head><br>
<body><br>
<?php<br>
.................<br>
?><br>
</body></html></pre><br>
========================================</p>
<p>understand?Please email to me,if U want!</p>

Reply With Quote
  #56  
Old October 31st, 2002, 04:41 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Good!

Thanks for intoduction!
It's funny :)


Reply With Quote
  #57  
Old April 20th, 2003, 01:08 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Cannot send session cache limiter

At the begining i thought that you were joking. After 10-20 differnt ways that i tried and nothing, i finaly decided to do what you recomented. IT WORKS!!!!!!!!!!!!!!!!!!!!!No more cache limiter just with a few backspaces! THX

Reply With Quote
  #58  
Old May 27th, 2003, 03:18 PM
Ducani
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Couch Sessions

Couch Sessions

May 02, 2000 - Need to build an online shopping cart in a hurry? This article takes a look at session management, an important component of transaction-based Web sites, and explains the fundamentals of adding session support to your site. Examples in PHP4 and PHP3 with PHPLib.

Please discuss this article in this thread. You can read the article here .

Reply With Quote
  #59  
Old May 28th, 2003, 09:05 AM
Ducani
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
If you would like to see an article covering a particular topic, please post your request here.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Couch Sessions

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap