Solved

PHP Session Forcing it to use cookies

Posted on 2004-03-24
1
183 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to dynamically set the form action using jQuery.
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…

813 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

11 Experts available now in Live!

Get 1:1 Help Now