Jump to content

Recommended Posts

Ok so say I have this is the cookie after its set

(this is example cookie from Firefox)

name:user

Content:123456-%64%69%72%74%79%73%70%61%63%65%77

Domain:.domain.com

Path: /

Send For:any type of connection

Expires: when browser is closed

 

So how would I go about adding that info using set cookie. I wanted a before and after that way its easier to understand. I have tried this code thinking it should work

 

<?php

setcookie('user', '123456-%64%69%72%74%79%73%70%61%63%65%77', false , '/', '.domain.com', 0);

?>

 

But that doesnt work I know how to set a regular cookie.. But am having problem with this being a session cookie. Best I can figure all you do is set the time to 0 or False and it should go away once browser is closed.

 

I would appreciate any help can give

Link to comment
https://forums.phpfreaks.com/topic/50762-php-set-cookie/
Share on other sites

ok..... simply ,dont add the stuff thats specific.....

 

 

i dont see why you would bneed to specify the browser type, and if its only used for the one browser, then why do you need to specify the domain etc.?

 

 

all you need is name = value, and thats it......

 

if you want a cookie that expires, when someone logs out, then simply put in a system where if theyve been in for 20 minutes, get then to login again, this also helps to aviod auto scripts etc.

 

 

 

if you ned more help, lets me know

 

Link to comment
https://forums.phpfreaks.com/topic/50762-php-set-cookie/#findComment-249595
Share on other sites

I dont understand what your saying? I mean I only grabbed that as an example. So I show the output of the code. And have someone show me exactly how I would get that output. And the whole reason is to learn.

 

I would just like to know exactly what code I would need to give me that exact output.  To be honest your answer really doesnt help at all. But thank your for the suggestion.

 

 

Link to comment
https://forums.phpfreaks.com/topic/50762-php-set-cookie/#findComment-249666
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.