eZdia Forum Forum Index
eZdia Forum
A forum for eZdia lovers
www.eZdia.com

 FAQFAQ    RegisterRegister   Log inLog in 
The time now is Wed Feb 08, 2012 12:04 pm
eZdia Forum Forum Index
 ProfileProfile  UsergroupsUsergroups   Log in to check your private messagesLog in to check your private messages 
How to create session:

 
Post new topic   Reply to topic    eZdia Forum Forum Index -> Web Development
View previous topic :: View next topic  
Author Message
AidenJordan



Joined: 14 May 2009
Posts: 2

PostPosted: Thu May 14, 2009 12:11 pm    Post subject: How to create session: Reply with quote

Hi, This is Aiden
I want to know how I create session in PHP.
Back to top
View user's profile Send private message
stefenalex112



Joined: 14 May 2009
Posts: 1

PostPosted: Thu May 14, 2009 12:26 pm    Post subject: Re: Reply with quote

Hi,
First of all you create object of that session at caoonection page like-
ob_start();
session_start();
Then
$_SESSION[desire session name]="Desired value to be stored in Session variable".
Thnx
Back to top
View user's profile Send private message
vikas72



Joined: 21 Dec 2007
Posts: 199

PostPosted: Sat May 16, 2009 9:47 pm    Post subject: Reply with quote

This is a helpful indicator. However, there are complete session tutorial elsewhere in the net and you should take that up.
_________________
http://starredreviews.com
Back to top
View user's profile Send private message
Fardoragh



Joined: 01 Jun 2009
Posts: 8

PostPosted: Mon Jun 01, 2009 3:19 pm    Post subject: Reply with quote

Hi, All,
Sessions are wonder full feature of php and its inbuilt.
One can just write
Code:
session_start();
and the session will start. Session are stored on server side. HTTP protocol is state less protocol so, we need to use session to keep track which user is doing what.
Unique Session ID is assigned to each user who has logged in to the website and session start is executed.

One this should be keep in mind that the session_start(); should be the first line in the php file.
See Tutorials on Website Development.

You can register a variable in session using following code
Code:
$_SESSION['variable_name']="some value"


For more tutorials on php sessions visit WebWorldGuru.com[/url]
Back to top
View user's profile Send private message
Alyssa



Joined: 13 Jun 2009
Posts: 7

PostPosted: Sat Jun 13, 2009 1:39 pm    Post subject: Reply with quote

Hello stefenalex112,
I used this code in PHP, I created object to a session.
and next started a session.
after that I created Session name.
but how can I run this code and where Can I put.
_________________
http://ezdia.org
Back to top
View user's profile Send private message
Fnand



Joined: 28 Jun 2009
Posts: 36

PostPosted: Fri Jul 03, 2009 12:04 pm    Post subject: session Reply with quote

hey jordan here is the way you can create a session- just tell me if it worked for you
To create a session in php, we have to give the code as below…
session_start() on the top of the file and if u use this code at the top of the file. and then it will create a session in php.
Back to top
View user's profile Send private message
jitendra45



Joined: 04 Jul 2009
Posts: 26

PostPosted: Sat Jul 04, 2009 10:10 am    Post subject: start session Reply with quote

hi jordan here is how to do it,
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
If you want to use a named session, you must call session_name() before calling session_start().
session_start() will register internal output handler for URL rewriting when trans-sid is enabled. If a user uses ob_gzhandler or like with ob_start(), the order of output handler is important for proper output. For example, user must register ob_gzhandler before session start.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    eZdia Forum Forum Index -> Web Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Po wer xed by php B B © 2001, 2005 php BB Group | A Forum Home |