Solved

PHP Session Forcing it to use cookies

Posted on 2004-03-24
1
177 Views
Last Modified: 2012-05-04
Is there a way to force a PHP session to use cookies as opposed to just passing around the session id?  I'm not the administrator of the server, so i'm looking for a solution i can do right out of the php code.  

0
Comment
Question by:ldsnerd
1 Comment
 
LVL 1

Accepted Solution

by:
j_chakraverty earned 50 total points
ID: 10672849
[1] method 1
set a cookie using a php header function
example
header(cookiename=cookievalue, expires= saturday, 05-feb-00 22:03:38 GMT; path=/;domain=yourdomain.com);

[2] method 2 recommended is using set cookie
example
setcookie( "variable name", "variable value", time()+3600. "/", "domain name",o);

check out php help for setcookie u can delete a cookie by same function and no value setcookie("variable name")
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now