顯示具有 google 標籤的文章。 顯示所有文章
顯示具有 google 標籤的文章。 顯示所有文章

2022/11/04

如何讓 FAANG 的人資一眼看上你 - Github、Blog、互動式履歷網站篇

除了一般履歷外,工程師求職大多會要求附上 github 或是作品集連結

我自己是另外還寫了網站式履歷,在面試過程中還有一邊寫 blog
意外的很多面試官看,還特別喜歡互動式網站式履歷 (下面第 2.3 點會提到),
也很欣賞我在 blog 上堅持分享技術和經驗的態度與精神。


一、Github

1.1 頁面敘述 & Demo




關於這塊平常就需要累積了,不管是 side project,參與 open surces 開發都行。

如果對方有興趣可能會 clone 專案下來看,但如果沒空可能就是頁面掃掃,
所以定期維護自己的頁面很重要,不管怎樣我都會讓對方看到首頁的時候至少可以看到關於每個專案的簡短敘述。

所以專案的 readme.md 我會寫上這個專案的目標、敘述、不會掛掉的展示作品的網址、使用的技術、相關功能的 demo 和說明、參考資料、版本更新紀錄、使用工具

如果他不想看程式,可以靠這方式大致知道我專案的畫面、功能與技術,更進一步的話可能還會點進網站玩玩。

2020/09/02

Chrome SameSite Cookie Policy Causes Problem :: Logout When Direct To External Website Then Back Own Site



Recently I am working on a function, when user submits the form then it will direct to the external website, and we will give a return URL via the form, let the external website can lead the users back to our website after finish their manipulation.


Then I encountered a problem, the users will be automatically logged out when the external websites redirect to our website.


After debugging, I discovered that the session ID is different from the origin session ID when users direct back to our website, and it only occurs in Chrome, Safari, IE, Edge, firefox works fine.


Why? It turns out that Chrome enforces set SameSite = LAX cookies, so we need to set the SameSite = 'None', that Secure will be available on a third-party website.


So, Let's start to edit the SamSite attribute,
First, you may want to know "Is that the logout reason really was caused by SameSite ?"
That's fine, we can test it w/o modifying code.
Enter chrome://flags/ in the URL bar,
search "Samesite" then turn it as disabled,
press the button "Relaunch" to relaunch the setting on the bottom right corner.





To test the users will log out or not.
If it works, then the problem definitely is SameSite.



However, that's impossible to ask every user to change the setting,
that's all right we have a couple of methods to solve the problem,



1. Set the header


If your PHP version < 7.3.0

header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure');

or

header('Set-Cookie: cookie2=name; SameSite=None; Secure', false);



If your PHP version >= 7.3.0

setcookie('cookie2', 'name', ['samesite' => 'None', 'secure' => true]);

or

setcookie('cross-site-cookie', 'name', ['samesite' => 'None', 'secure' => true]);

Use the name of 'sessionID' to replace 'name' 
If you setting success you will see the context which was wrapped by red line.






2. Set the .htaccess

Header always edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=None"



3. Set the httpd.conf


Header always edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=None"

Remember to reload the apache after setting up